MCPcopy
hub / github.com/webpack/webpack-dev-server / startProxy

Function startProxy

test/e2e/ipc.test.js:38–54  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

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(() => {

Callers 1

ipc.test.jsFile · 0.70

Calls 2

createServerMethod · 0.80
listenMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…