Readonly
developmentReadonly
hostnameReadonly
pendingHow many requests are in-flight right now?
Readonly
portStop listening to prevent new connections from being accepted.
It does not close existing connections.
It may take a second or two to actually stop.
Stop listening to prevent new connections from being accepted.
It does not close existing connections.
It may take a second or two to actually stop.
Generated using TypeDoc
HTTP & HTTPS Server
To start the server, see serve
Often, you don't need to interact with this object directly. It exists to help you with the following tasks:
For performance, Bun pre-allocates most of the data for 2048 concurrent requests. That means starting a new server allocates about 500 KB of memory. Try to avoid starting and stopping the server often (unless it's a new instance of bun).
Powered by a fork of uWebSockets. Thank you @alexhultman.