add meaningful name to the example server

this server name will appear at autobahn summary report.
if we do not set the server name, it will display ugly `unknown server`.
This commit is contained in:
jangko 2021-05-21 16:53:17 +07:00
parent c38ddf89de
commit 30d4f5ca17
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
"outdir": "./reports/servers",
"servers": [
{
"name": "nim-ws example server",
"url": "ws://127.0.0.1:8888/ws"
}
],

View File

@ -27,6 +27,11 @@ proc process(r: RequestFence): Future[HttpResponseRef] {.async.} =
except WebSocketError as exc:
error "WebSocket error:", exception = exc.msg
let header = HttpTable.init([
("Server", "nim-ws example server")
])
discard await request.respond(Http200, "Hello World")
else:
return dumbResponse()