* Initialize engine * * @param srv - the server to attach to * @param opts - options passed to engine.io * @private
(
srv: TServerInstance,
opts: EngineOptions & AttachOptions,
)
| 591 | * @private |
| 592 | */ |
| 593 | private initEngine( |
| 594 | srv: TServerInstance, |
| 595 | opts: EngineOptions & AttachOptions, |
| 596 | ): void { |
| 597 | class="cm">// initialize engine |
| 598 | debug(class="st">"creating engine.io instance with opts %j", opts); |
| 599 | this.eio = attach(srv as HTTPServer, opts); |
| 600 | |
| 601 | class="cm">// attach static file serving |
| 602 | if (this._serveClient) this.attachServe(srv); |
| 603 | |
| 604 | class="cm">// Export http server |
| 605 | this.httpServer = srv; |
| 606 | |
| 607 | class="cm">// bind to engine events |
| 608 | this.bind(this.eio); |
| 609 | } |
| 610 | |
| 611 | /** |
| 612 | * Attaches the static file serving. |
no test coverage detected