WebSocket 502 http_protocol_error even with HTTP/2 to Origin OFF

What is the name of the domain?

hellochia.io

What is the error number?

502

What is the error message?

HTTP/1.1 502 Bad Gateway – Proxy-Status: Cloudflare-Proxy; error=http_protocol_error

What is the issue you’re encountering

A WebSocket request returns 502 through Cloudflare but succeeds (101) when the record is grey-clouded.

What steps have you taken to resolve the issue?

  • Network → WebSockets = ON
  • Speed → Optimization → HTTP/2 to Origin = OFF
  • Purged Everything after toggling
  • Tested direct to origin (grey cloud) → 101 Switching Protocols
  • Tested proxied (orange cloud) → 502 http_protocol_error
  • Latest Ray-ID: 9371ba90cb345e64-EWR

What are the steps to reproduce the issue?

  1. Orange-cloud the A record for hellochia.io (Proxy status = Proxied)

  2. Run this WebSocket handshake:

    curl --http1.1 -v
    -H “Connection: Upgrade”
    -H “Upgrade: websocket”
    -H “Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==”
    -H “Sec-WebSocket-Version: 13”
    https://hellochia.io/mstts/cognitiveservices/websocket/v1?X-ConnectionId=test

  3. Observe the response:
    HTTP/1.1 502 Bad Gateway
    Proxy-Status: Cloudflare-Proxy; error=http_protocol_error
    (Ray-ID appears in the headers)

Screenshot of the error

This topic was automatically closed after 15 days. New replies are no longer allowed.