nim-websock/test/server.nim
2020-12-01 18:13:59 +05:30

9 lines
194 B
Nim

import ../ws, chronos, asynchttpserver
proc cb(req: Request) {.async.} =
var ws = await newWebSocket(req)
ws.close()
var server = newAsyncHttpServer()
waitFor server.serve(Port(9001), cb)