WebSocket message lost using Traefik as Proxy #2629
Labels
area/websocket
kind/bug/possible
a possible bug that needs analysis before it is confirmed or fixed.
status/5-frozen-due-to-age
Milestone
Do you want to request a feature or report a bug?
bug
What did you do?
Use Traefik as proxy for WebSocket server. For simplicity, we use a rather simple server-client model for test. When a client connects to the server, the server will send 5 messages to the client immediately. The server is behind a Traefik proxy.
The simple Server Client code to reproduce the problem can be found here:
https://github.com/datamesh-oss/traefik-ws
What did you expect to see?
Clients will receive all 5 messages.
What did you see instead?
Sometimes the Client receive only 3 or 4 messages. (The client will stuck forever since it expects 5 messages.) Some messages get dropped by Traefik.
This problem does not exist when we use nginx as proxy or no proxy at all.
Also, when we add a short delay before sending each message, the possibility to see the problem happen decreases. (e.g. the problem appears less often if we increase the delay from 1ms to 2ms)
I suspect it's a race condition somewhere in Traefik. Or there might be something wrong with the gorilla/websocket packages (but it's hard to explain why direct link or proxy from nginx has no such problem. Is it possible that we missed some Traefik configurations?).
Output of
traefik version
: (What version of Traefik are you using?)Version: v1.5.0-rc3
Codename: cancoillotte
Go version: go1.9.2
Built: 2017-12-20_02:24:44PM
OS/Arch: darwin/amd64
What is your environment & configuration (arguments, toml, provider, platform, ...)?
If applicable, please paste the log output in debug mode (
--debug
switch)The text was updated successfully, but these errors were encountered: