Skip to content

Configuration ​

On top of the common configuration (see Configuration), a Socket.IO application adds the [socketio] section. Since socketio depends on the web feature, the [web] section from the web guide also applies.

KeyTypeDefaultDescription
ack-timeoutOption<TimeConfig>5sMaximum time for outgoing ACKs
connect-timeoutOption<TimeConfig>45sTime limit to complete initial connection
max-buffer-sizeOption<usize>128Max buffered packets per connection
max-payloadOption<ByteConfig>100KBMaximum outgoing payload size
ping-intervalOption<TimeConfig>25sServer ping interval
ping-timeoutOption<TimeConfig>20sPong timeout before disconnect
req-pathOption<String>"/socket.io"HTTP path where Socket.IO is mounted
transportsOption<Vec<String>>["polling", "websocket"]Allowed transports
parser"common" | "msgpack""common"Payload parser
ws-read-buffer-sizeOption<usize>4096WebSocket read buffer size

TOML example ​

toml
[socketio]
ack-timeout = "5s"
connect-timeout = "45s"
max-buffer-size = 128
max-payload = "100KB"
ping-interval = "25s"
ping-timeout = "20s"
req-path = "/socket.io"
transports = ["polling", "websocket"]
parser = "common"
ws-read-buffer-size = 4096