listenHTTP
- HTTPListener listenHTTP(Settings _settings, HTTPServerRequestDelegate request_handler)
@safe
listenHTTP
if (
is(
Settings ==
string) ||
)
- HTTPListener listenHTTP(Settings settings, HTTPServerRequestFunction request_handler)
- HTTPListener listenHTTP(Settings settings, HTTPServerRequestHandler request_handler)
- HTTPListener listenHTTP(Settings settings, HTTPServerRequestDelegateS request_handler)
- HTTPListener listenHTTP(Settings settings, HTTPServerRequestFunctionS request_handler)
- HTTPListener listenHTTP(Settings settings, HTTPServerRequestHandlerS request_handler)
- HTTPListener listenHTTP(Settings settings, void delegate(HTTPServerRequest, HTTPServerResponse) @(system) request_handler)
- HTTPListener listenHTTP(Settings settings, void function(HTTPServerRequest, HTTPServerResponse) @(system) request_handler)
- HTTPListener listenHTTP(Settings settings, void delegate(scope HTTPServerRequest, scope HTTPServerResponse) @(system) request_handler)
- HTTPListener listenHTTP(Settings settings, void function(scope HTTPServerRequest, scope HTTPServerResponse) @(system) request_handler)
index vibe http server
aliasesclassesenumsfunctionsinterfacespropertiesstructs
Starts a HTTP server listening on the specified port.
request_handler will be called for each HTTP request that is made. The res parameter of the callback then has to be filled with the response data.
request_handler can be either HTTPServerRequestDelegate/HTTPServerRequestFunction or a class/struct with a member function 'handleRequest' that has the same signature.
Note that if the application has been started with the --disthost command line switch, listenHTTP() will automatically listen on the specified VibeDist host instead of locally. This allows for a seamless switch from single-host to multi-host scenarios without changing the code. If you need to listen locally, use listenHTTPPlain() instead.