Skip to content

Commit

Permalink
Fix websocket only binds to localhost #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
yflory committed Aug 18, 2023
1 parent 22747cb commit 650e4c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/http-worker.js
Expand Up @@ -599,9 +599,9 @@ app.use(function (err, req, res /*, next*/) {
var server = Http.createServer(app);

nThen(function (w) {
server.listen(Env.httpPort, w());
server.listen(Env.httpPort, Env.httpAddress, w());
if (Env.httpSafePort) {
server.listen(Env.httpSafePort, w());
server.listen(Env.httpSafePort, Env.httpAddress, w());
}
server.on('upgrade', function (req, socket, head) {
// TODO warn admins that websockets should only be proxied in this way in a dev environment
Expand Down
2 changes: 1 addition & 1 deletion server.js
Expand Up @@ -81,7 +81,7 @@ nThen(function (w) {
process.exit(1);
}
Env.httpServer = Http.createServer(app);
Env.httpServer.listen(Env.websocketPort, 'localhost', w(function () {
Env.httpServer.listen(Env.websocketPort, Env.httpAddress, w(function () {
Env.Log.info('WEBSOCKET_LISTENING', {
port: Env.websocketPort,
});
Expand Down

0 comments on commit 650e4c4

Please sign in to comment.