Model HttpServer

http/server::HttpServer


Parameters

↳ const bind: string
↳ const routes: Vec<string>


Sources

⤇ failed_binding: http/server::failed_binding
⤇ incoming: http/server::incoming with @HttpRequest


A HTTP server for general use.

The HTTP server provides configuration for receiving and responding to HTTP incoming requests.

  • bind: The network address and port to listen, under the form <ip/name>:<port>.
  • routes: The list of routes the server manages, usually at least composed of ["/"].

HttpServer aims to be used with connection treatment. Every time a new HTTP request matching a configured route comes, a new track is created with @HttpRequest context.

ℹ️ If server binding fails, failed_binding is emitted.

⚠️ Using HttpServer directly with incoming source and outgoing treatment should be done carefully.