Listen on ipv6
This commit is contained in:
parent
7579171ee7
commit
d878c4c1b4
1 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@
|
||||||
##
|
##
|
||||||
## waitFor server.serve(Port(8080), cb)
|
## waitFor server.serve(Port(8080), cb)
|
||||||
|
|
||||||
import tables, asyncnet, asyncdispatch, parseutils, uri, strutils
|
import tables, asyncnet, asyncdispatch, parseutils, uri, strutils, nativesockets
|
||||||
import httpcore
|
import httpcore
|
||||||
|
|
||||||
export httpcore except parseHeader
|
export httpcore except parseHeader
|
||||||
|
|
@ -241,7 +241,7 @@ proc serve*(server: AsyncHttpServer, port: Port,
|
||||||
## specified address and port.
|
## specified address and port.
|
||||||
##
|
##
|
||||||
## When a request is made by a client the specified callback will be called.
|
## 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:
|
if server.reuseAddr:
|
||||||
server.socket.setSockOpt(OptReuseAddr, true)
|
server.socket.setSockOpt(OptReuseAddr, true)
|
||||||
if server.reusePort:
|
if server.reusePort:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue