Skip to content

SocketServerOptions beta ​

Interface of @v12-engine/engine/server

ts
export interface SocketServerOptions

What startSocketServer is started with: the port, the log and the limits and compression of its connections

Members ​

compress ​

ts
compress?: boolean;

Whether to compress what goes over connections whose other end can take it. Yes when left out

idleTimeout ​

ts
idleTimeout?: number;

Seconds a connection may say nothing before it is closed: it is pinged meanwhile, and a browser answers a ping by itself, so only one that is gone (a machine that vanished without closing) goes. 60 when left out

log ​

ts
log?: Logger;

Where it says what goes wrong with a connection. The root logger when left out

maxBuffered ​

ts
maxBuffered?: number;

Bytes waiting to go out to a connection, at most: one that takes what it is sent too slowly is closed, where it once queued in the server's memory without end. 16 MB when left out

maxConnections ​

ts
maxConnections?: number;

Connections open at once, at most: one more is answered 503 and never upgraded (RV38). 1024 when left out

maxMessage ​

ts
maxMessage?: number;

Characters a message may have at most: a longer one closes the connection. 64 KB when left out

onRequest ​

ts
onRequest?: Parameters<typeof createServer>[1];

What answers plain HTTP requests: a page saying what this is, by default

port ​

ts
port: number;

Port to listen on: 0 for any free one