Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default bindAddress to 127.0.0.1 #2086

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions http/vibe/http/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ unittest
void test()
{
static void testSafeFunction(HTTPServerRequest req, HTTPServerResponse res) @safe {}
listenHTTP("0.0.0.0:8080", &testSafeFunction);
listenHTTP("127.0.0.1:8080", &testSafeFunction);
listenHTTP(":8080", new class HTTPServerRequestHandler {
void handleRequest(HTTPServerRequest req, HTTPServerResponse res) @safe {}
});
Expand Down Expand Up @@ -629,9 +629,9 @@ final class HTTPServerSettings {

/** The interfaces on which the HTTP server is listening.

By default, the server will listen on all IPv4 and IPv6 interfaces.
By default, the server will listen on `127.0.0.1`.
*/
string[] bindAddresses = ["::", "0.0.0.0"];
string[] bindAddresses = ["127.0.0.1"];

/** Determines the server host name.

Expand Down Expand Up @@ -785,7 +785,7 @@ final class HTTPServerSettings {
///
unittest {
auto s = new HTTPServerSettings(":8080");
assert(s.bindAddresses == ["::", "0.0.0.0"]); // default bind addresses
assert(s.bindAddresses == ["127.0.0.1"]); // default bind addresses
assert(s.port == 8080);

s = new HTTPServerSettings("123.123.123.123");
Expand Down