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

Function doOpen

packages/engine.io-client/lib/transports/websocket.ts:23–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 }
22
23 override doOpen() {
24 const uri = this.uri();
25 const protocols = this.opts.protocols;
26
27 // React Native only supports the 'headers' option, and will print a warning if anything else is passed
28 const opts = isReactNative
29 ? {}
30 : pick(
31 this.opts,
32 "agent",
33 "perMessageDeflate",
34 "pfx",
35 "key",
36 "passphrase",
37 "cert",
38 "ca",
39 "ciphers",
40 "rejectUnauthorized",
41 "localAddress",
42 "protocolVersion",
43 "origin",
44 "maxPayload",
45 "family",
46 "checkServerIdentity",
47 );
48
49 if (this.opts.extraHeaders) {
50 opts.headers = this.opts.extraHeaders;
51 }
52
53 try {
54 this.ws = this.createSocket(uri, protocols, opts);
55 } catch (err) {
56 return this.emitReserved("error", err);
57 }
58
59 this.ws.binaryType = this.socket.binaryType;
60
61 this.addEventListeners();
62 }
63
64 abstract createSocket(
65 uri: string,

Callers

nothing calls this directly

Calls 4

pickFunction · 0.90
addEventListenersMethod · 0.80
uriMethod · 0.45
createSocketMethod · 0.45

Tested by

no test coverage detected