Skip to content

Commit

Permalink
Add max http size parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmi committed Nov 13, 2023
1 parent 69e6762 commit 940acc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export const SOCKET_PATH =
process.env.WIREIO_SOCKET_PATH || process.env.SOCKET_PATH || '/socket.io';
export const SOCKET_COMPAT = ['1', 'true'].includes(process.env.SOCKET_COMPAT);
export const PORT = process.env.WIREIO_PORT || process.env.PORT || 4000;
export const MAX_HTTP_BUFFER_SIZE = process.env.WIREIO_MAX_HTTP_BUFFER_SIZE || 1e6 /*1MB*/;

if (SOCKET_COMPAT) {
console.log(`Socket.io 2.X compatibility is enabled`);
}

startServer({
socketIOConfig: { path: SOCKET_PATH, allowEIO3: SOCKET_COMPAT },
socketIOConfig: { path: SOCKET_PATH, allowEIO3: SOCKET_COMPAT, maxHttpBufferSize: MAX_HTTP_BUFFER_SIZE },
port: PORT,
});

0 comments on commit 940acc8

Please sign in to comment.