Model HttpServer

http/server::HttpServer


Parameters

↳ const host: string
↳ const port: u16


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.

  • host: the network address to bind with.
  • port: the port to bind with.

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.

⚠️ Use HttpServer with connection treatment, as using incoming source and outgoing treatment directly should be done carefully.