Interface: Server
An HTTP server instance.
Properties
port
readonlyport:number
The port the server is listening on.
Methods
close()
close():
void
Close the server.
Returns
void
upgrade()
upgrade(
request,options?):boolean
Upgrade an HTTP request to a WebSocket connection. Must be called synchronously inside the fetch handler.
Parameters
request
Request
The incoming request with an Upgrade: websocket header.
options?
Options for the WebSocket connection.
Returns
boolean
true if the upgrade was successful, false otherwise.