I'm trying to make a websocket application work on Traefik 2.3, but when I send request to traefik I get 502 as following.
time="2021-01-27T10:08:17Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/json\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Connection\":[\"Upgrade\"],\"Origin\":[\"http://localhost:4443\"],\"Sec-Websocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-Websocket-Key\":[\"nbMGA+vLk//P91QRwUi5rQ==\"],\"Sec-Websocket-Version\":[\"13\"],\"Upgrade\":[\"websocket\"],\"X-Forwarded-Host\":[\"localhost:4443\"],\"X-Forwarded-Port\":[\"4443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"26d62bbceae5\"],\"X-Real-Ip\":[\"172.19.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"localhost:4443\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.19.0.1:57154\",\"RequestURI\":\"/json\",\"TLS\":null}"
time="2021-01-27T10:08:17Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" ForwardURL="http://9cc6620bf077:4441" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/json\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Connection\":[\"Upgrade\"],\"Origin\":[\"http://localhost:4443\"],\"Sec-Websocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-Websocket-Key\":[\"nbMGA+vLk//P91QRwUi5rQ==\"],\"Sec-Websocket-Version\":[\"13\"],\"Upgrade\":[\"websocket\"],\"X-Forwarded-Host\":[\"localhost:4443\"],\"X-Forwarded-Port\":[\"4443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"26d62bbceae5\"],\"X-Real-Ip\":[\"172.19.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"localhost:4443\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.19.0.1:57154\",\"RequestURI\":\"/json\",\"TLS\":null}"
time="2021-01-27T10:08:17Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 172.19.0.3:4441: connect: connection refused"
time="2021-01-27T10:08:17Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/json\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Connection\":[\"Upgrade\"],\"Origin\":[\"http://localhost:4443\"],\"Sec-Websocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-Websocket-Key\":[\"nbMGA+vLk//P91QRwUi5rQ==\"],\"Sec-Websocket-Version\":[\"13\"],\"Upgrade\":[\"websocket\"],\"X-Forwarded-Host\":[\"localhost:4443\"],\"X-Forwarded-Port\":[\"4443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"26d62bbceae5\"],\"X-Real-Ip\":[\"172.19.0.1\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"localhost:4443\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"172.19.0.1:57154\",\"RequestURI\":\"/json\",\"TLS\":null}"
My route is
[http.routers]
[http.routers.wss-server-server]
rule = "Host(`localhost`)"
service = "wss-server"
middlewares = [
"midleware-chain-websocket"
]
tls=true
entrypoints = [
"wss"
]
[http.services]
[http.services.wss-server.loadBalancer]
passHostHeader = false
[[http.services.wss-server.loadBalancer.servers]]
url = "http//:myserverwss:4441"
my midleware only put X-forward
[http.middlewares.midleware-chain-websocket.chain]
middlewares = ["websocket-midleware-headers"]
[http.middlewares.websocket-midleware-headers.headers.customRequestHeaders]
X-Forwarded-Proto = ["https"]