SocketioOptions
Defined in: socketio.ts:15
Properties
Section titled “Properties”
optionalcors?:boolean|CorsOptions
Defined in: socketio.ts:31
Enable CORS on the socket.io handshake. socket.io attaches its own request listener to the
underlying HTTP server (for the /socket.io/* path) ahead of the HTTP transport’s own
middleware, so @mantlejs/express’s cors option — or the equivalent on @mantlejs/koa /
@mantlejs/http — never runs for it; a browser client on a different origin than the API
(the common case: a frontend dev server and an API dev server on different ports) cannot
open a socket at all without this. true resolves to permissive defaults (reflects
Origin, allows the CRUD verbs, no credentials); pass a CorsOptions object to customize
origin/methods/headers/credentials. Disabled (no CORS headers) by default — set this
whenever the client’s url differs from the page’s own origin. An explicit
serverOptions.cors always wins over this option.
optionalpath?:string
Defined in: socketio.ts:18
serverOptions?
Section titled “serverOptions?”
optionalserverOptions?:Partial<ServerOptions>
Defined in: socketio.ts:16
timeout?
Section titled “timeout?”
optionaltimeout?:number
Defined in: socketio.ts:17