Interface: HttpServerLike
Makaio Framework / contracts / HttpServerLike
Interface: HttpServerLike
Section titled “Interface: HttpServerLike”Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:38
Minimal Node-compatible HTTP server interface for WebSocket upgrade handling and port resolution.
This contract models servers that expose Node’s upgrade event. Bun’s
native Bun.Server uses server.upgrade(request) from the fetch handler
instead, so Bun hosts should expose WebSocket routing through a Bun-specific
host seam rather than returning Bun.Server as HttpServerLike.
Methods
Section titled “Methods”address()
Section titled “address()”address():
string|ServerAddress|null
Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:67
Return the bound address of the server.
Returns null when the server is not yet listening. Returns a
ServerAddress when bound to a TCP port. The string case
(Unix domain socket) is not used by the relay but is included for
compatibility with Node.js Server#address() callers.
Returns
Section titled “Returns”string | ServerAddress | null
Server address, pipe path string, or null
off(
event,handler):void
Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:56
Remove a previously attached event handler from the server.
Only the 'upgrade' event is required by this contract.
Parameters
Section titled “Parameters”"upgrade"
The event name to remove the handler from.
handler
Section titled “handler”The handler to remove.
Returns
Section titled “Returns”void
on(
event,handler):void
Defined in: ../../../packages/contracts/src/capabilities/server/types.ts:47
Attach an event handler to the server.
Only the 'upgrade' event is required by this contract; implementors
may support additional events via overloads.
Parameters
Section titled “Parameters”"upgrade"
The event name to listen for.
handler
Section titled “handler”The handler to invoke when the event fires.
Returns
Section titled “Returns”void