Server Configuration
Minimal Example
Configuration config = new Configuration();
config.setHostname("127.0.0.1");
config.setPort(9092);
config.setContext("/socket.io");
config.setTransports(Transport.POLLING, Transport.WEBSOCKET);
config.setStoreFactory(new RedisStoreFactory(redissonClient));For connection auth check here.
Network & Binding
hostname
String
null
Bind address. If unset, binds to 0.0.0.0 / ::0
port
int
-1
Server port (must be set)
context
String
/socket.io
Socket.IO context path
config.setHostname("0.0.0.0");
config.setPort(9092);
config.setContext("/socket.io");Threading Model
bossThreads
int
0
CPU * 2 when value sets to 0
workerThreads
int
0
CPU * 2 when value sets to 0
Transport Configuration
transports
List<Transport>
WEBSOCKET, POLLING
Enabled transports
transportType
TransportType
AUTO
Native IO selection (EPOLL / KQUEUE / IO_URING / NIO)
upgradeTimeout
int (ms)
10000
Polling → WebSocket upgrade timeout
Heartbeat & Timeouts
pingInterval
25000 ms
Ping interval
pingTimeout
60000 ms
Ping timeout (0 disables)
firstDataTimeout
5000 ms
Prevents silent channel attacks
ℹ️ Ping interval vs ping timeout
pingIntervaldefines how often the server sends heartbeat pings to keep the connection alive (NAT keep-alive).pingTimeoutdefines how long the server waits without a pong before considering the client disconnected.In short: interval = how often to check, timeout = how long to wait before giving up.
Payload & Frame Limits
maxHttpContentLength
64 KB
Max HTTP request size
maxFramePayloadLength
64 KB
Max WebSocket frame size
CORS & HTTP Behavior
enableCors
true
Enable CORS
origin
null
Access-Control-Allow-Origin
allowHeaders
null
Access-Control-Allow-Headers
addVersionHeader
true
Adds Server header
allowCustomRequests
false
Allow non-Socket.IO requests
Compression
httpCompression
true
GZIP / Deflate
websocketCompression
true
permessage-deflate
Buffer & ACK Handling
preferDirectBuffer
true
Use Netty direct buffers
ackMode
AUTO_SUCCESS_ONLY
Auto-ACK behavior
Session & Security
randomSession
false
Randomize session IDs
needClientAuth
false
TLS client authentication
JSON Serialization
jsonSupport
Auto-detected
Jackson-based by default
Authorization
authorizationListener
Allow all
Handshake authorization
Exception Handling
exceptionListener
DefaultExceptionListener
Global exception hook
Store / Clustering
SSL / TLS
HTTP Decoder Tuning
maxInitialLineLength
Netty default
maxHeaderSize
Netty default
maxChunkSize
Netty default
Last updated
Was this helpful?