From 2424f2b215c0546f97d8b147e21544521c7545b0 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Fri, 16 Sep 2022 21:38:37 +0200 Subject: [PATCH] configure SNI hostname when connecting WSS (#128) When connecting to WebSocket via TLS, certain servers require hostname to be sent as part of SNI extension. This was done when using `news` backend, but not when using `nim-websock` backend. Aligned both impls. --- websock/websock.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/websock/websock.nim b/websock/websock.nim index 3845d39..8a8b4e3 100644 --- a/websock/websock.nim +++ b/websock/websock.nim @@ -236,6 +236,7 @@ proc connect*( return WebSocket.connect( host = uri.hostname & ":" & uri.port, path = uri.path, + hostName = uri.hostname, protocols = protocols, factories = factories, hooks = hooks,