(httpServer)
| 96 | |
| 97 | // TODO: update superagent as latest release now supports promises |
| 98 | export 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 | |
| 110 | export function eioPush(httpServer, sid: string, body: string): Promise<void> { |
| 111 | return new Promise((resolve) => { |
no test coverage detected