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

Function eioHandshake

packages/socket.io/test/support/util.ts:98–108  ·  view source on GitHub ↗
(httpServer)

Source from the content-addressed store, hash-verified

96
97// TODO: update superagent as latest release now supports promises
98export function eioHandshake(httpServer): Promise<string> {
99 return new Promise((resolve) => {
100 request(httpServer)
101 .get("/socket.io/")
102 .query({ transport: "polling", EIO: 4 })
103 .end((err, res) => {
104 const sid = JSON.parse(res.text.substring(1)).sid;
105 resolve(sid);
106 });
107 });
108}
109
110export function eioPush(httpServer, sid: string, body: string): Promise<void> {
111 return new Promise((resolve) => {

Callers 3

close.tsFile · 0.90
initFunction · 0.90

Calls 1

endMethod · 0.45

Tested by

no test coverage detected