From 30d4f5ca173c56899bc5a63e0639072a63445e9d Mon Sep 17 00:00:00 2001 From: jangko Date: Fri, 21 May 2021 16:53:17 +0700 Subject: [PATCH] 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`. --- autobahn/fuzzingclient.json | 3 ++- examples/server.nim | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autobahn/fuzzingclient.json b/autobahn/fuzzingclient.json index ec96834c43..876318e53b 100644 --- a/autobahn/fuzzingclient.json +++ b/autobahn/fuzzingclient.json @@ -2,10 +2,11 @@ "outdir": "./reports/servers", "servers": [ { + "name": "nim-ws example server", "url": "ws://127.0.0.1:8888/ws" } ], "cases": ["*"], "exclude-cases": ["6.*", "9.*", "12.*", "13.*"], "exclude-agent-cases": {} -} \ No newline at end of file +} diff --git a/examples/server.nim b/examples/server.nim index 7950bb7521..baa79afab6 100644 --- a/examples/server.nim +++ b/examples/server.nim @@ -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()