From 1067507c41810a24eccc02ee7645b762d25b2a0e Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 28 Oct 2020 11:29:43 -0500 Subject: [PATCH] Proxy to 0.0.0.0 instead of localhost --- src/node/proxy.ts | 4 ++-- src/node/routes/proxy.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/proxy.ts b/src/node/proxy.ts index 4c861d0f..a95badad 100644 --- a/src/node/proxy.ts +++ b/src/node/proxy.ts @@ -80,7 +80,7 @@ router.all("*", (req, res, next) => { proxy.web(req, res, { ignorePath: true, - target: `http://127.0.0.1:${port}${req.originalUrl}`, + target: `http://0.0.0.0:${port}${req.originalUrl}`, }) }) @@ -95,6 +95,6 @@ router.ws("*", (socket, head, req, next) => { proxy.ws(req, socket, head, { ignorePath: true, - target: `http://127.0.0.1:${port}${req.originalUrl}`, + target: `http://0.0.0.0:${port}${req.originalUrl}`, }) }) diff --git a/src/node/routes/proxy.ts b/src/node/routes/proxy.ts index 8c83827a..29aa999a 100644 --- a/src/node/routes/proxy.ts +++ b/src/node/routes/proxy.ts @@ -9,9 +9,9 @@ export const router = Router() const getProxyTarget = (req: Request, rewrite: boolean): string => { if (rewrite) { const query = qs.stringify(req.query) - return `http://127.0.0.1:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}` + return `http://0.0.0.0:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}` } - return `http://127.0.0.1:${req.params.port}/${req.originalUrl}` + return `http://0.0.0.0:${req.params.port}/${req.originalUrl}` } router.all("/(:port)(/*)?", (req, res) => {