Skip to content

Commit

Permalink
Add test for IPv6 HTTP client requests (#2080).
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Feb 23, 2018
1 parent 8c9a601 commit 2fdba09
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/vibe.http.2080/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "2080",
"dependencies": {
"vibe-d:http": { "path": "../../" }
}
}
22 changes: 22 additions & 0 deletions tests/vibe.http.2080/source/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/++ dub.sdl:
dependency "vibe-d" version="~>0.8.3-alpha.4"
+/
import vibe.core.core;
import vibe.http.client;
import vibe.http.server;

void main()
{
auto settings = new HTTPServerSettings;
settings.port = 8080;
settings.bindAddresses = ["::1"];
listenHTTP(settings, (req, res) { res.writeBody("Hello, World!"); });

runTask({
auto resp = requestHTTP("http://[::1]:8080/");
assert(resp.statusCode == 200, resp.toString);
resp.dropBody();
exitEventLoop();
});
runApplication();
}

0 comments on commit 2fdba09

Please sign in to comment.