cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

🐛 cloudflared tunnel - websocket connection not working - 502 bad gateway

Open matrad opened this issue 2 years ago • 1 comments

Describe the bug Tunnelling a Websocket over the cloudflared Tunnel does not works

To Reproduce Steps to reproduce the behavior:

  1. Configure the Tunnel start it with
  2. Open the Website Containing the Tunnel
  3. See error in the Javascript Console
Bildschirmfoto 2023-10-17 um 01 15 08

Debug-Log of Cloudflared:

2023-10-16T23:10:42Z DBG GET https://refresh-sit-portrait-cargo.trycloudflare.com/ HTTP/1.1 cfRay=8173fa0bd1e6b397-MUC connIndex=0 content-length=0 event=1 headers={"Accept":["*/*"],"Accept-Encoding":["gzip"],"Accept-Language":["de-DE,de;q=0.9"],"Cache-Control":["no-cache"],"Cdn-Loop":["cloudflare; subreqs=1"],"Cf-Connecting-Ip":["***.****.****.****"],"Cf-Ew-Via":["15"],"Cf-Ipcountry":["IT"],"Cf-Ray":["8173fa0bd1e6b397-MUC"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cf-Warp-Tag-Id":["09533866-fe49-43fc-84cf-64ea3ae6a01c"],"Cf-Worker":["trycloudflare.com"],"Origin":["https://refresh-sit-portrait-cargo.trycloudflare.com"],"Pragma":["no-cache"],"Sec-Websocket-Key":["jrhqNXgixOBkGEBeLsOmKQ=="],"Sec-Websocket-Version":["13"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"],"X-Forwarded-For":["***.****.****"],"X-Forwarded-Proto":["https"]} host=refresh-sit-portrait-cargo.trycloudflare.com ingressRule=0 path=/
2023-10-16T23:10:42Z DBG 502 Bad Gateway cfRay=8173fa0bd1e6b397-MUC connIndex=0 content-length=166 event=1

If it's an issue with Cloudflare Tunnel: 5. Tunnel ID : a1983976-8666-4900-818c-7e2480de6317 6. cloudflared config: (remote-managed)

Expected behavior The Websocket should connect, how it is in Local

Environment and versions

root@webserver:~# cloudflared --version
cloudflared version 2023.8.2 (built 2023-08-31-1506 UTC)

What am I doing wrong? Is there an issue with cloudflared and websockets?

matrad avatar Oct 16 '23 23:10 matrad

any news?

TryCloudflare does not support SSE, but does it support WebSocket?

eric-gitta-moore avatar Dec 08 '25 11:12 eric-gitta-moore