xshell 1.3.25 → 1.3.26

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/net.common.d.ts CHANGED
@@ -102,6 +102,7 @@ export interface RemoteOptions {
102
102
  print?: boolean;
103
103
  /** `false` 打印所有交互的 rpc messages */
104
104
  verbose?: boolean;
105
+ proxy?: string;
105
106
  /** 使用者自定义的在 websocket 连接出错时,或者 handlers 出错时的处理
106
107
  用户设置后会覆盖默认的 print 错误功能 */
107
108
  on_error?(error: WebSocketConnectionError | Error, remote: Remote): void;
@@ -141,6 +142,7 @@ export declare class Remote {
141
142
  print: boolean;
142
143
  /** `false` 打印所有交互的 rpc messages */
143
144
  verbose: boolean;
145
+ proxy?: string;
144
146
  /** 防止作为 websocket 连接发起方时并发创建 websocket 连接 */
145
147
  lwebsocket: Lock<WebSocket>;
146
148
  /** map<id, message handler>: 通过 (rpc message).id 找到对应的 handler
@@ -154,7 +156,7 @@ export declare class Remote {
154
156
  error: WebSocketConnectionError | Error;
155
157
  /** 作为 websocket 连接发起方,传入 url
156
158
  作为 websocket 连接接收方,传入 websocket + name */
157
- constructor({ name, url, websocket, funcs, print, verbose, alive, args, on_error, on_reconnect, on_connected }?: RemoteOptions);
159
+ constructor({ name, url, websocket, funcs, print, verbose, alive, args, proxy, on_error, on_reconnect, on_connected }?: RemoteOptions);
158
160
  /** 统一处理首次连接和连接后的 websocket 错误 */
159
161
  _on_error: (error: WebSocketConnectionError | Error) => void;
160
162
  on_reconnect?: (this: Remote) => Promise<void>;
package/net.common.js CHANGED
@@ -213,6 +213,7 @@ export class Remote {
213
213
  print = true;
214
214
  /** `false` 打印所有交互的 rpc messages */
215
215
  verbose = false;
216
+ proxy;
216
217
  // --- states
217
218
  /** 防止作为 websocket 连接发起方时并发创建 websocket 连接 */
218
219
  lwebsocket = new Lock();
@@ -227,7 +228,7 @@ export class Remote {
227
228
  error;
228
229
  /** 作为 websocket 连接发起方,传入 url
229
230
  作为 websocket 连接接收方,传入 websocket + name */
230
- constructor({ name, url, websocket, funcs, print, verbose, alive, args, on_error, on_reconnect, on_connected } = {}) {
231
+ constructor({ name, url, websocket, funcs, print, verbose, alive, args, proxy, on_error, on_reconnect, on_connected } = {}) {
231
232
  if (name)
232
233
  this.name = name;
233
234
  if (alive) {
@@ -280,6 +281,8 @@ export class Remote {
280
281
  this.print = print;
281
282
  if (verbose !== undefined)
282
283
  this.verbose = verbose;
284
+ if (proxy)
285
+ this.proxy = proxy;
283
286
  if (on_error)
284
287
  this.on_error = on_error;
285
288
  }
@@ -368,7 +371,8 @@ export class Remote {
368
371
  on_message: this._on_message,
369
372
  on_error: this._on_error,
370
373
  print: this.print,
371
- keep_alive_duration: this.alive ? 30_000 : undefined
374
+ keep_alive_duration: this.alive ? 30_000 : undefined,
375
+ proxy: this.proxy
372
376
  });
373
377
  this.error = null;
374
378
  if (this.args)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.25",
3
+ "version": "1.3.26",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {