Skip to content

Commit

Permalink
trust proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
dolled-possum committed Jan 5, 2025
1 parent 26114ec commit 2bca60a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ server.on('upgrade', (req, socket, head) => {
// Handle new client connections on the wss
wss.on('connection', (clientSocket, req, remoteSocket) => {
const clientId = ++connectionCounter;
const clientIdAndHost = `${clientId} ${req.host}`
const clientIdAndHost = `${clientId} ${req.hostname}`
tsLog(`[client #${clientIdAndHost}] Handshake complete (remote is open)`);

// Forward messages client -> remote
Expand Down
1 change: 1 addition & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ const app = express();
const routes = require('./routes.js');

app.use(routes);
app.set('trust proxy', true);

module.exports = app;

0 comments on commit 2bca60a

Please sign in to comment.