vibe.d beta banner
get vibe.d
0.8.1

Asynchronous I/O that doesn’t get in your way, written in D

HTTPServerSettings.this - multiple declarations

Function HTTPServerSettings.this

Constructs a new settings object with default values.

this () @safe;

Function HTTPServerSettings.this

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

this (
  string bind_string
) @safe;

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.

Throws

An exception is thrown if bind_string is malformed.

Example

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);
}
Authors

Sönke Ludwig, Jan Krüger, Ilya Shipunov

Copyright

© 2012-2013 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.