Skip to content

WebSocket Connections fail with Internal Server Error #5

Description

@samuel-p

First of all thanks for this great Traefik plugin. I played around with it for some days and found out that the middleware actually breaks WebSocket connections. I'm not 100% sure why, because I'm really new to developing Traefik plugins and also not an expert with Go, but I would assume that it is because WebSocket connections remain open permanently/significantly longer than normal http requests.

If I try to open a WebSocket connection with websocat I get this error:

$ docker run --rm -ti ghcr.io/vi/websocat wss://domain.com/ws
websocat: WebSocketError: WebSocketError: Received unexpected status code (500 Internal Server Error)
websocat: error running

For me, I found a workaround in just allowing WebSocket requests in general, but I don't think that's the best solution and probably there might be a better solution to achieve this. I also checked the similar project by tomMoulard and also found a similar issue and merge request there. Unfortunately I could not figure out if this issue/merge request is really related or not.

If you are interested in my workaround you can find it here: https://github.com/samuel-p/traefik-plugin-fail2ban/blob/test/fail2ban.go#L178

I could also open a merge request, but as I hope there could be a better solution for that, I decided to open an issue first. So let me know, if you like me to create a merge request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions