diff options
Diffstat (limited to 'lib/pure/httpserver.nim')
-rw-r--r-- | lib/pure/httpserver.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/httpserver.nim b/lib/pure/httpserver.nim index 38a068ea1..dc76c9228 100644 --- a/lib/pure/httpserver.nim +++ b/lib/pure/httpserver.nim @@ -363,7 +363,7 @@ proc run*(handleRequest: proc (client: Socket, port = Port(80)) = ## encapsulates the server object and main loop var s: TServer - open(s, port) + open(s, port, reuseAddr = true) #echo("httpserver running on port ", s.port) while true: next(s) @@ -514,7 +514,7 @@ proc close*(h: PAsyncHTTPServer) = ## Closes the ``PAsyncHTTPServer``. h.asyncSocket.close() -when isMainModule: +when not defined(testing) and isMainModule: var counter = 0 var s: TServer |