Timeout for establishing a connection to the server
Can be used to force looking up IPv4/IPv6 addresses for host names.
Forces a specific network interface to use for outgoing connections.
Timeout during read operations on the underyling transport
Allows to customize the TLS context before connecting to a server.
TLS Peer name override.
void test() { HTTPClientSettings settings = new HTTPClientSettings; settings.proxyURL = URL.parse("http://proxyuser:proxypass@192.168.2.50:3128"); settings.defaultKeepAliveTimeout = 0.seconds; // closes connection immediately after receiving the data. requestHTTP("http://www.example.org", (scope req){ req.method = HTTPMethod.GET; }, (scope res){ logInfo("Headers:"); foreach (key, ref value; res.headers.byKeyValue) { logInfo("%s: %s", key, value); } logInfo("Response: %s", res.bodyReader.readAllUTF8()); }, settings); }
Defines an HTTP/HTTPS proxy request or a connection timeout for an HTTPClient.