(addr: string, prefix?: string)
| 17 | } |
| 18 | |
| 19 | export function makeSocketIo(addr: string, prefix?: string) { |
| 20 | prefix = removeTrail((prefix ?? "").trim(), "/"); |
| 21 | return io(parseForwardAddress(addr, "ws"), { |
| 22 | path: prefix + "/socket.io", |
| 23 | multiplex: false, |
| 24 | reconnectionDelayMax: 1000 * 10, |
| 25 | timeout: 1000 * 30, |
| 26 | reconnection: true, |
| 27 | reconnectionAttempts: 3, |
| 28 | rejectUnauthorized: false |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | export function useSocketIoClient() { |
| 33 | let socket: Socket<DefaultEventsMap, DefaultEventsMap> | undefined; |
no test coverage detected