HTTPServerSettings.this

Constructs a new settings object with a custom bind interface and/or port.

The syntax of bind_string is [<IP address>][:<port>], where either of the two parts can be left off. IPv6 addresses must be enclosed in square brackets, as they would within a URL.

  1. this()
  2. this(string bind_string)
    class HTTPServerSettings
    @safe
    this
    ()

Throws

An exception is thrown if bind_string is malformed.

Examples

auto s = new HTTPServerSettings(":8080");
assert(s.bindAddresses == ["::", "0.0.0.0"]); // default bind addresses
assert(s.port == 8080);

s = new HTTPServerSettings("123.123.123.123");
assert(s.bindAddresses == ["123.123.123.123"]);
assert(s.port == 80);

s = new HTTPServerSettings("[::1]:443");
assert(s.bindAddresses == ["::1"]);
assert(s.port == 443);

Meta