MCPcopy
hub / github.com/socketio/socket.io / initEngine

Method initEngine

packages/socket.io/lib/index.ts:593–609  ·  packages/socket.io/lib/index.ts::Server.initEngine

* Initialize engine * * @param srv - the server to attach to * @param opts - options passed to engine.io * @private

(
    srv: TServerInstance,
    opts: EngineOptions & AttachOptions,
  )

Source from the content-addressed store, hash-verified

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.

Callers 1

attachMethod · 0.95

Calls 4

attachServeMethod · 0.95
bindMethod · 0.95
attachFunction · 0.90
debugFunction · 0.85

Tested by

no test coverage detected