mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-16 03:40:42 -05:00
Websocket Notification Traefik #275
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @budimanjojo on GitHub (Apr 11, 2019).
Hello, I just migrated from Nginx to Traefik. And everything works perfectly unless my Bitwarden. So, I followed the proxy example from https://github.com/dani-garcia/bitwarden_rs/wiki/Proxy-examples and set WEBSOCKET_ENABLED=true in the env file.
This is what I got from the log:
[ws::handler][ERROR] WS Error <Protocol>: Unable to parse WebSocket key.I can't even access my vault, browser shows this error:
WebSocket Protocol Error: Unable to parse WebSocket key.If I comment out the line:
in my docker-compose file, then everything is working again except I can't auto sync my data across devices.
This is my docker-compose file (example domain name of course):
And this is my config.env file (example domain and credentials of course):
Thanks before 👍
@mprasil commented on GitHub (Apr 11, 2019):
@fbartels had that issue and the culprit was some headers missing. I see you have some extra labels set for your container, maybe one of those is blocking some headers? I'd try to remove those and strip down the configuration to the example on wiki, if that works, try adding more labels until it breaks again.
@budimanjojo commented on GitHub (Apr 11, 2019):
Thanks for your fast reply. I just commented out all the "traefik.frontend.header*" label in the compose file. And the problem persists. Here's the entire logs, maybe you can find something:
Thanks again :)
@budbay commented on GitHub (Apr 11, 2019):
@budimanjojo I had a similar issue, try adding this label to your docker-compose:
- "traefik.hub.protocol=ws"I added this in between the other two .hub labels and it resolved the websocket key error for me.
EDIT:
i also removed this line:
- "traefik.backend=bitwarden_rs"@budimanjojo commented on GitHub (Apr 12, 2019):
Wow it works. Thanks @budbay :D
@mprasil commented on GitHub (Apr 12, 2019):
@budimanjojo I assume
traefik.hub.protocol=wshelped?Great help there @budbay! Any info where is this setting documented? I've seen most of the documentation recommending to just set it to http, but it looks like your setting is the correct one. I would like to update the wiki, just need to verify what this really does.
@budimanjojo commented on GitHub (Apr 12, 2019):
@mprasil Yes it solved my problem. Also, I needed to remove
traefik.backend=bitwarden_rslike @budbay mentioned. I was also curious and found out that there are 4 protocols supported, they are http, https, ws, wss (ws = websocket, wss = secure websocket) but I can't find the official documentation for this.I also found this: https://github.com/containous/traefik/issues/1027
@mprasil commented on GitHub (Apr 12, 2019):
Yeah removing backend makes sense, I'd expect that might break things and it's not in the sample proxy configuration.
I'm going to add the protocol settings on the wiki. Thanks for info.
@budbay commented on GitHub (Apr 12, 2019):
Sorry guys I don't have the source for the websocket label that I suggested. I had the same error mentioned and was trying to troubleshoot. I don't have any other containers with websockets being proxied by traefik so I started searching any info I could find on websockets and traefik. I came across setting the protocol somewhere and thought it made sense so I tried that and it worked. glad I could help and sorry I can't provide sources, as mentioned there's not much documented anywhere.
@budimanjojo commented on GitHub (Oct 20, 2019):
@budbay @mprasil Hello, sorry for bumping this issue. Traefik recently got v2.0 which require routers, services, and middlewares instead of frontend and backend. I'm planning to update my whole stack and got problem with the websocket. Any idea on how to use ws protocol in the new format? Thanks again