bdy 1.15.5-stage → 1.15.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/distTs/package.json +1 -1
- package/distTs/src/tunnel/server/ssh.js +27 -13
- package/package.json +1 -1
package/distTs/package.json
CHANGED
|
@@ -178,20 +178,34 @@ class ServerSsh extends events_1.default {
|
|
|
178
178
|
else
|
|
179
179
|
opts.env.PATH = `${process.env.PATH};C:\\Windows\\System32\\WindowsPowerShell\\v1.0`;
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
else {
|
|
182
|
+
opts.shell = true;
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const proc = (0, child_process_1.spawn)(command, opts);
|
|
186
|
+
if (proc.stdout) {
|
|
187
|
+
proc.stdout.on('data', (data) => {
|
|
188
|
+
stream.write(data);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (proc.stderr) {
|
|
192
|
+
proc.stderr.on('data', (data) => {
|
|
193
|
+
stream.stderr.write(data);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
proc.once('close', (code) => {
|
|
197
|
+
stream.exit(code || 0);
|
|
198
|
+
stream.end();
|
|
199
|
+
const [seconds, nano] = process.hrtime(s);
|
|
200
|
+
const ms = seconds * 1000 + nano / 1000 / 1000;
|
|
201
|
+
logger_1.default.debug(`local ssh exec ends: ${ms}ms`);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
stream.stderr.write(err?.message || 'Something went wrong');
|
|
206
|
+
stream.exit(1);
|
|
190
207
|
stream.end();
|
|
191
|
-
|
|
192
|
-
const ms = seconds * 1000 + nano / 1000 / 1000;
|
|
193
|
-
logger_1.default.debug(`local ssh exec ends: ${ms}ms`);
|
|
194
|
-
});
|
|
208
|
+
}
|
|
195
209
|
}
|
|
196
210
|
clientSession(session, client, proxyClient) {
|
|
197
211
|
let env = {};
|