* Initialize engine * * @param srv - the server to attach to * @param opts - options passed to engine.io * @private
(
srv: TServerInstance,
opts: EngineOptions & AttachOptions
)
| 516 | * @private |
| 517 | */ |
| 518 | private initEngine( |
| 519 | srv: TServerInstance, |
| 520 | opts: EngineOptions & AttachOptions |
| 521 | ): void { |
| 522 | // initialize engine |
| 523 | debug("creating engine.io instance with opts %j", opts); |
| 524 | this.eio = attach(srv, opts); |
| 525 | |
| 526 | // attach static file serving |
| 527 | if (this._serveClient) this.attachServe(srv); |
| 528 | |
| 529 | // Export http server |
| 530 | this.httpServer = srv; |
| 531 | |
| 532 | // bind to engine events |
| 533 | this.bind(this.eio); |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * Attaches the static file serving. |
no test coverage detected