(url, isProxy)
| 188 | } |
| 189 | |
| 190 | function doWebSocket(url, isProxy) { |
| 191 | let ws; |
| 192 | if (isProxy) { |
| 193 | const agent = new HttpsProxyAgent(SOCKET_PROXY_HOST); |
| 194 | ws = new WebSocket(url, { |
| 195 | agent, |
| 196 | rejectUnauthorized: false |
| 197 | }); |
| 198 | } else { |
| 199 | ws = new WebSocket(url, { |
| 200 | rejectUnauthorized: false |
| 201 | }); |
| 202 | } |
| 203 | |
| 204 | return ws; |
| 205 | } |
| 206 | |
| 207 | function proxyGet(url, params, headers = {}) { |
| 208 | return proxyRequest('GET', url, params, headers); |