(devServerOptions)
| 852 | // Start a backend WebSocket server (the user proxy target) and a dev-server |
| 853 | // proxying everything to it, with the given dev-server options merged in. |
| 854 | const setup = async (devServerOptions) => { |
| 855 | backendUpgradeCount = 0; |
| 856 | |
| 857 | backend = http.createServer(); |
| 858 | backendWss = new WebSocketServer({ server: backend }); |
| 859 | backendWss.on("connection", () => { |
| 860 | backendUpgradeCount += 1; |
| 861 | }); |
| 862 | |
| 863 | await new Promise((resolve) => { |
| 864 | backend.listen(port5, resolve); |
| 865 | }); |
| 866 | |
| 867 | server = new Server( |
| 868 | { |
| 869 | hot: true, |
| 870 | allowedHosts: "all", |
| 871 | proxy: [ |
| 872 | { |
| 873 | context: "/", |
| 874 | target: `http://localhost:${port5}`, |
| 875 | ws: true, |
| 876 | }, |
| 877 | ], |
| 878 | port: port3, |
| 879 | ...devServerOptions, |
| 880 | }, |
| 881 | webpack(config), |
| 882 | ); |
| 883 | |
| 884 | await server.start(); |
| 885 | }; |
| 886 | |
| 887 | const teardown = async () => { |
| 888 | for (const client of backendWss.clients) { |
no test coverage detected
searching dependent graphs…