kubernetes-bitwarden_rs icon indicating copy to clipboard operation
kubernetes-bitwarden_rs copied to clipboard

need websocket support

Open lvnilesh opened this issue 3 years ago • 6 comments

Need to update ingress so websocket is supported for sync

lvnilesh avatar Nov 15 '22 14:11 lvnilesh

Hi @lvnilesh can you please add more detail about what is not working for you?

icicimov avatar Nov 16 '22 01:11 icicimov

I haven't dug further, but my browser says

[2022-11-17T04:46:37.761Z] Information: (WebSockets transport) There was an error with the transport.

lvnilesh avatar Nov 17 '22 04:11 lvnilesh

Also, I see Dani mentions https://github.com/dani-garcia/vaultwarden/wiki/Enabling-WebSocket-notifications to make sure to pass the connection and upgrade headers but I can't see any references in the ingress.yaml

Route the /notifications/hub endpoint to the WebSocket server, by default at port 3012, making sure to pass the Connection and Upgrade headers. (Note the port can be changed with WEBSOCKET_PORT variable)

I must be missing something.

lvnilesh avatar Nov 17 '22 04:11 lvnilesh

Pushed an ingress update check if that works for you.

icicimov avatar Nov 17 '22 06:11 icicimov

Thanks. I applied and refreshed browser. I need to test more on a fresh clean machine.

What tools do you suggest to use to examine this specific header transport?

Browser still says:

WebSocketTransport.ts:74 WebSocket connection to 'wss://vault.example.com/notifications/hub?access_token=token' failed: 
(anonymous) @ WebSocketTransport.ts:74
t @ zone.js:1351
connect @ WebSocketTransport.ts:51
Utils.ts:199 [2022-11-17T19:05:19.160Z] Information: (WebSockets transport) There was an error with the transport.
Utils.ts:193 [2022-11-17T19:05:19.160Z] Error: Failed to start the connection: Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.

lvnilesh avatar Nov 17 '22 19:11 lvnilesh

You can always check the logs and look for hints there. Apart from that maybe try curl something like

$ curl -sSI \
       --no-buffer \
       --header "Connection: Upgrade" \
       --header "Upgrade: websocket" \
       --header "Host: socketsbay.com:443" \
       --header "Origin: https://socketsbay.com:443" \
       --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
       --header "Sec-WebSocket-Version: 13" \
       https://socketsbay.com:443/
HTTP/1.1 200 OK
Date: Thu, 17 Nov 2022 22:55:53 GMT
Server: Apache/2.4.41 (Ubuntu)
Set-Cookie: ci_session=lg9eg499i74vcnvui31cdjt606fv69kg; expires=Fri, 18-Nov-2022 00:55:53 GMT; Max-Age=7200; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: text/html; charset=UTF-8

targeting wss enabled site.

icicimov avatar Nov 17 '22 22:11 icicimov