xshell 1.0.108 → 1.0.109

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.108",
3
+ "version": "1.0.109",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -58,9 +58,9 @@
58
58
  "@babel/traverse": "^7.24.6",
59
59
  "@koa/cors": "^5.0.0",
60
60
  "@types/ws": "^8.5.10",
61
- "@typescript-eslint/eslint-plugin": "^7.10.0",
62
- "@typescript-eslint/parser": "^7.10.0",
63
- "@typescript-eslint/utils": "^7.10.0",
61
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
62
+ "@typescript-eslint/parser": "^7.11.0",
63
+ "@typescript-eslint/utils": "^7.11.0",
64
64
  "@xterm/addon-fit": "^0.10.0",
65
65
  "@xterm/addon-web-links": "^0.11.0",
66
66
  "@xterm/addon-webgl": "^0.18.0",
package/server.d.ts CHANGED
@@ -81,6 +81,8 @@ export declare class Server {
81
81
  on_upgrade(request: IncomingMessage, socket: Duplex, head: Buffer): void;
82
82
  /** 可被子类重写添加额外的中间件,在 start 时被调用 */
83
83
  init_app(app: Koa): Promise<void>;
84
+ /** 可被子类重写,有了 http_server 和 http2_server 后在 listen 之前做一些自定义处理逻辑 */
85
+ init_server(): Promise<void>;
84
86
  entry(ctx: Context, next: Next): Promise<void>;
85
87
  /** 解析 req.body to request.body
86
88
  处理 request.ip */
package/server.js CHANGED
@@ -210,6 +210,7 @@ export class Server {
210
210
  };
211
211
  }
212
212
  }
213
+ await this.init_server();
213
214
  await Promise.all([
214
215
  http && new Promise(resolve => {
215
216
  this.http_server.listen(this.http_port, resolve);
@@ -274,6 +275,9 @@ export class Server {
274
275
  /** 可被子类重写添加额外的中间件,在 start 时被调用 */
275
276
  async init_app(app) {
276
277
  }
278
+ /** 可被子类重写,有了 http_server 和 http2_server 后在 listen 之前做一些自定义处理逻辑 */
279
+ async init_server() {
280
+ }
277
281
  async entry(ctx, next) {
278
282
  let { response } = ctx;
279
283
  await this.parse(ctx);