From 6a2c9a7dbe19ac6b5b3cb88717a4e041af47d07e Mon Sep 17 00:00:00 2001 From: <> Date: Fri, 18 Dec 2020 06:42:58 +0000 Subject: [PATCH] Deployed 461a645 with MkDocs version: 1.1.2 --- CHANGELOG/index.html | 8 ++++++ index.html | 2 +- search/search_index.json | 2 +- sitemap.xml | 18 +++++++------- sitemap.xml.gz | Bin 200 -> 199 bytes ws/index.html | 52 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 71 insertions(+), 11 deletions(-) diff --git a/CHANGELOG/index.html b/CHANGELOG/index.html index bf4deb99..dc1143d3 100644 --- a/CHANGELOG/index.html +++ b/CHANGELOG/index.html @@ -98,6 +98,10 @@
All changes to this project will be documented in this file.
+(ws) Implement simple header based websocket authorization technique to reject +client which do not supply a certain header ("Authorization") with a special +value (see doc).
(ixwebsocket) Handle EINTR return code in ix::poll and IXSelectInterrupt
It is possible to pass custom HTTP header when doing the connection handshake, +the remote server might process them to implement a simple authorization +scheme.
+src$ ws connect -H Authorization:supersecret ws://localhost:8008
+Type Ctrl-D to exit prompt...
+[2020-12-17 22:35:08.732] [info] Authorization: supersecret
+Connecting to url: ws://localhost:8008
+> [2020-12-17 22:35:08.736] [info] ws_connect: connected
+[2020-12-17 22:35:08.736] [info] Uri: /
+[2020-12-17 22:35:08.736] [info] Headers:
+[2020-12-17 22:35:08.736] [info] Connection: Upgrade
+[2020-12-17 22:35:08.736] [info] Sec-WebSocket-Accept: 2yaTFcdwn8KL6IzSMj2u6Le7KTg=
+[2020-12-17 22:35:08.736] [info] Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15; client_max_window_bits=15
+[2020-12-17 22:35:08.736] [info] Server: ixwebsocket/11.0.4 macos ssl/SecureTransport zlib 1.2.11
+[2020-12-17 22:35:08.736] [info] Upgrade: websocket
+[2020-12-17 22:35:08.736] [info] Received 25 bytes
+ws_connect: received message: Authorization suceeded!
+[2020-12-17 22:35:08.736] [info] Received pong ixwebsocket::heartbeat::30s::0
+hello
+> [2020-12-17 22:35:25.157] [info] Received 7 bytes
+ws_connect: received message: hello
+
+If the wrong header is passed in, the server would close the connection with a custom close code (>4000, and <4999).
+[2020-12-17 22:39:37.044] [info] Upgrade: websocket
+ws_connect: connection closed: code 4001 reason Permission denied
+
+The ws echo server will respond what the client just sent him. If we use the +simple --http_authorization_header we can enforce that client need to pass a +special value in the Authorization header to connect.
+$ ws echo_server --http_authorization_header supersecret
+[2020-12-17 22:35:06.192] [info] Listening on 127.0.0.1:8008
+[2020-12-17 22:35:08.735] [info] New connection
+[2020-12-17 22:35:08.735] [info] remote ip: 127.0.0.1
+[2020-12-17 22:35:08.735] [info] id: 0
+[2020-12-17 22:35:08.735] [info] Uri: /
+[2020-12-17 22:35:08.735] [info] Headers:
+[2020-12-17 22:35:08.735] [info] Authorization: supersecret
+[2020-12-17 22:35:08.735] [info] Connection: Upgrade
+[2020-12-17 22:35:08.735] [info] Host: localhost:8008
+[2020-12-17 22:35:08.735] [info] Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=15; client_max_window_bits=15
+[2020-12-17 22:35:08.735] [info] Sec-WebSocket-Key: eFF2Gf25dC7eC15Ab1135G==
+[2020-12-17 22:35:08.735] [info] Sec-WebSocket-Version: 13
+[2020-12-17 22:35:08.735] [info] Upgrade: websocket
+[2020-12-17 22:35:08.735] [info] User-Agent: ixwebsocket/11.0.4 macos ssl/SecureTransport zlib 1.2.11
+[2020-12-17 22:35:25.157] [info] Received 7 bytes
+
ws proxy_server --remote_host ws://127.0.0.1:9000 -v
Listening on 127.0.0.1:8008