2

My server is distributing websocket client connections over 4 local websocket servers.

Is it possible to instruct haProxy to accept only WebSocket version 13 (RFC 6455) ?

i.e. Verify if Sec-WebSocket-Version: 13 is set

Jack
  • 161
  • 2
  • 9

1 Answers1

5

In your frontend section:

acl websocket13 hdr_val(Sec-WebSocket-Version) eq 13
use_backend my_backend if websocket13

The first line says that if the header Sec-WebSocket-Version equals 13, then set a flag called websocket13. The second line says to use the backend section my_backend if the websocket13 flag is set.

longneck
  • 23,082
  • 4
  • 52
  • 86