(callback)
| 36 | await server.start(); |
| 37 | |
| 38 | function startProxy(callback) { |
| 39 | const proxy = httpProxy.createProxyServer({ |
| 40 | target: { socketPath: server.options.ipc }, |
| 41 | }); |
| 42 | |
| 43 | const proxyServer = http.createServer((request, response) => { |
| 44 | // You can define here your custom logic to handle the request |
| 45 | // and then proxy the request. |
| 46 | proxy.web(request, response); |
| 47 | }); |
| 48 | |
| 49 | proxyServer.on("upgrade", (request, socket, head) => { |
| 50 | proxy.ws(request, socket, head); |
| 51 | }); |
| 52 | |
| 53 | return proxyServer.listen(proxyPort, proxyHost, callback); |
| 54 | } |
| 55 | |
| 56 | const proxy = await new Promise((resolve) => { |
| 57 | const proxyCreated = startProxy(() => { |
no test coverage detected
searching dependent graphs…