Interface: ServeOptions
Options for configuring the HTTP server.
Properties
fetch
fetch:
FetchHandler
Handler function called for each incoming HTTP request.
http3?
optionalhttp3?:boolean
If true, also serve HTTP/3 over QUIC (UDP) on the same port and
advertise it to HTTP/1.1 and HTTP/2 clients with an Alt-Svc
response header. Requires tls (QUIC is always TLS 1.3).
Defaults to false.
listenIp?
optionallistenIp?:string
IP address to bind to. Defaults to '0.0.0.0'.
port?
optionalport?:number
Port to listen on. Defaults to 0 (random available port).
tls?
optionaltls?:TlsOptions
TLS options for enabling HTTPS. When provided, the server listens for HTTPS connections.
websocket?
optionalwebsocket?:WebSocketHandlers
Optional WebSocket event handlers for upgraded connections.