Skip to content

Socket.io: How to change server options on runtime #4342

Discussion options

You must be logged in to vote

Hi! You can use the path() method:

import { Server } from "socket.io";

const io = new Server(3000);

io.path("/myownpath/");

Reference: https://socket.io/docs/v4/server-api/#serverpathvalue

For the other options, you may need to update the opts attribute of the underlying engine, for example:

io.engine.opts.maxHttpBufferSize = 1e8;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sarathmunusamy93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants