MCPcopy Index your code
hub / github.com/socketio/socket.io / initEngine

Method initEngine

lib/index.ts:518–534  ·  view source on GitHub ↗

* 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

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.

Callers 1

attachMethod · 0.95

Calls 2

attachServeMethod · 0.95
bindMethod · 0.95

Tested by

no test coverage detected