# HAProxy HTTP/1.1 to HTTP/2 WebSocket Conversion

**URL:** <https://discourse.haproxy.org/t/haproxy-http-1-1-to-http-2-websocket-conversion/11406>\
**Category:** Help!\
**Created:** [November 17, 2024, 5:51am UTC](https://discourse.haproxy.org/t/haproxy-http-1-1-to-http-2-websocket-conversion/11406 "2024-11-17T05:51:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ririnto](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@ririnto](https://discourse.haproxy.org/u/ririnto)\
**Post date:** [November 17, 2024, 5:51am UTC](https://discourse.haproxy.org/t/haproxy-http-1-1-to-http-2-websocket-conversion/11406/1 "2024-11-17T05:51:30Z")

</div>

I am considering the following architecture:

User → HAProxy → Envoy → WebSocket Server

- User → HAProxy: HTTP/1.1
- HAProxy → Envoy: HTTP/2
- Envoy → WebSocket Server: HTTP/1.1

However, it seems that my HAProxy only supports HTTP/2 for the connection itself and doesn’t effectively utilize MUX or similar features. It feels like it’s falling short in this aspect.

On the other hand, I’ve confirmed that the WebSocket connection works properly through an HTTP/2 tunnel when using the following architecture:

User → Edge-Envoy → HAProxy → Envoy → WebSocket Server

- User → Edge-Envoy: HTTP/1.1
- Edge-Envoy → HAProxy: HTTP/2
- HAProxy → Envoy: HTTP/2
- Envoy → WebSocket Server: HTTP/1.1

I am also aware of **RFC 8441** , which defines the “Bootstrapping WebSockets with HTTP/2” extension. This allows WebSocket connections to be established over an HTTP/2 connection using the `ENABLE_CONNECT_PROTOCOL` setting. However, HAProxy currently supports RFC 8441 in a **bypass** manner only and does not fully handle WebSocket upgrades. As a result, HAProxy seems to have limitations when dealing with WebSocket connections in an HTTP/2 environment.

Is there a way to work around HAProxy’s limitations to properly handle HTTP/2 WebSocket tunneling in the first architecture? Or should I always consider adding an additional Edge-Envoy layer for this scenario? Any recommendations or insights would be greatly appreciated!
