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:
parent
c38ddf89de
commit
30d4f5ca17
|
@ -2,6 +2,7 @@
|
||||||
"outdir": "./reports/servers",
|
"outdir": "./reports/servers",
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
|
"name": "nim-ws example server",
|
||||||
"url": "ws://127.0.0.1:8888/ws"
|
"url": "ws://127.0.0.1:8888/ws"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -27,6 +27,11 @@ proc process(r: RequestFence): Future[HttpResponseRef] {.async.} =
|
||||||
|
|
||||||
except WebSocketError as exc:
|
except WebSocketError as exc:
|
||||||
error "WebSocket error:", exception = exc.msg
|
error "WebSocket error:", exception = exc.msg
|
||||||
|
|
||||||
|
let header = HttpTable.init([
|
||||||
|
("Server", "nim-ws example server")
|
||||||
|
])
|
||||||
|
|
||||||
discard await request.respond(Http200, "Hello World")
|
discard await request.respond(Http200, "Hello World")
|
||||||
else:
|
else:
|
||||||
return dumbResponse()
|
return dumbResponse()
|
||||||
|
|
Loading…
Reference in New Issue