diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2017-02-25 02:20:16 +0200 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2017-02-25 02:20:16 +0200 |
commit | d878c4c1b46a938e6d593218284d80faa386d849 (patch) | |
tree | eb10322ffd0b5da0ac2b115ff560cea078f794b0 | |
parent | 7579171ee7dfa6cc816b336b708003ffee9821cc (diff) | |
download | Nim-d878c4c1b46a938e6d593218284d80faa386d849.tar.gz |
Listen on ipv6
-rw-r--r-- | lib/pure/asynchttpserver.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim index a558d9d7e..672eb34a0 100644 --- a/lib/pure/asynchttpserver.nim +++ b/lib/pure/asynchttpserver.nim @@ -31,7 +31,7 @@ ## ## waitFor server.serve(Port(8080), cb) -import tables, asyncnet, asyncdispatch, parseutils, uri, strutils +import tables, asyncnet, asyncdispatch, parseutils, uri, strutils, nativesockets import httpcore export httpcore except parseHeader @@ -241,7 +241,7 @@ proc serve*(server: AsyncHttpServer, port: Port, ## specified address and port. ## ## When a request is made by a client the specified callback will be called. - server.socket = newAsyncSocket() + server.socket = newAsyncSocket(AF_INET6) if server.reuseAddr: server.socket.setSockOpt(OptReuseAddr, true) if server.reusePort: |