Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
interface ServerOptions
import { type ServerOptions } from "https://deno.land/x/socket_io@0.2.0/packages/engine.io/mod.ts";

Properties

path: string

Name of the request path to handle

pingTimeout: number

Duration in milliseconds without a pong packet to consider the connection closed

pingInterval: number

Duration in milliseconds before sending a new ping packet

upgradeTimeout: number

Duration in milliseconds before an uncompleted transport upgrade is cancelled

maxHttpBufferSize: number

Maximum size in bytes or number of characters a message can be, before closing the session (to avoid DoS).

optional
allowRequest: (req: Request, connInfo: ConnInfo) => Promise<void>

A function that receives a given handshake or upgrade request as its first parameter, and can decide whether to continue or not.

optional
cors: CorsOptions

The options related to Cross-Origin Resource Sharing (CORS)

optional
editHandshakeHeaders: (
responseHeaders: Headers,
req: Request,
connInfo: ConnInfo,
) => void | Promise<void>

A function that allows to edit the response headers of the handshake request

optional
editResponseHeaders: (
responseHeaders: Headers,
req: Request,
connInfo: ConnInfo,
) => void | Promise<void>

A function that allows to edit the response headers of all requests