Skip to content

Commit 1067507

Browse files
committed
Proxy to 0.0.0.0 instead of localhost
1 parent f2f1fee commit 1067507

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/node/proxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ router.all("*", (req, res, next) => {
8080

8181
proxy.web(req, res, {
8282
ignorePath: true,
83-
target: `http://127.0.0.1:${port}${req.originalUrl}`,
83+
target: `http://0.0.0.0:${port}${req.originalUrl}`,
8484
})
8585
})
8686

@@ -95,6 +95,6 @@ router.ws("*", (socket, head, req, next) => {
9595

9696
proxy.ws(req, socket, head, {
9797
ignorePath: true,
98-
target: `http://127.0.0.1:${port}${req.originalUrl}`,
98+
target: `http://0.0.0.0:${port}${req.originalUrl}`,
9999
})
100100
})

src/node/routes/proxy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export const router = Router()
99
const getProxyTarget = (req: Request, rewrite: boolean): string => {
1010
if (rewrite) {
1111
const query = qs.stringify(req.query)
12-
return `http://127.0.0.1:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}`
12+
return `http://0.0.0.0:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}`
1313
}
14-
return `http://127.0.0.1:${req.params.port}/${req.originalUrl}`
14+
return `http://0.0.0.0:${req.params.port}/${req.originalUrl}`
1515
}
1616

1717
router.all("/(:port)(/*)?", (req, res) => {

0 commit comments

Comments
 (0)