Class HTTPServerContext
Represents a single HTTP server port.
class HTTPServerContext
;
This class defines the incoming interface, port, and TLS configuration of the public server port. The public server port may differ from the local one if a reverse proxy of some kind is facing the public internet and forwards to this HTTP server.
Multiple virtual hosts can be configured to be served from the same port. Their TLS settings must be compatible and each virtual host must have a unique name.
Constructors
Name | Description |
---|---|
this
(bind_address, bind_port)
|
Properties
Name | Type | Description |
---|---|---|
bindAddress [get]
|
string | The local network interface IP address associated with this listener |
bindPort [get]
|
ushort | The local port associated with this listener |
hasVirtualHosts [get]
|
bool | Determines if any virtual hosts have been addded |
tlsContext [get]
|
TLSContext | Returns the TLS context associated with the listener. |
Methods
Name | Description |
---|---|
addVirtualHost
(settings, request_handler)
|
Adds a single virtual host. |
removeVirtualHost
(id)
|
Removes a previously added virtual host using its ID. |