-1

I know that there is an ALB and NLB option that works with websockets. I can't understand why classic ELB with HTTP protocol doesn't work with websocket connections, although at the instance there is Nginx which is configured to add connection and upgrade headers. Once I switch it to TCP protocol it works. Can you explain how exactly this protocol works when there is HTTP proxy in the middle?

It is still using same TCP, as soon as client reached the server and Nginx added upgrade headers, server response with switch protocol message should reach the client and then they just use TCP of established HTTP connection. What is the reason it drops this connection on an ELB, response buffering, or it just drops all non HTTP traffic?

So Nginx sends to ELB

 HTTP/1.1 101 Switching Protocols
Server: nginx/1.13.1
Date: Sat, 21 Mar 2020 07:53:38 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: PozdkhgL/Zdkgh3kwu0KkACFCt0=

But ELB never deliver it back to client, and request get timed out.

kenlukas
  • 2,886
  • 2
  • 14
  • 25
ogbofjnr
  • 161
  • 1
  • 7

2 Answers2

5

The Classic ELB doesn't support Websockets. Why it doesn't is not something AWS publishes. From the chart in the reference below it specifically calls out, as you pointed out, that the ALB and NLB support Websockets. Why the Classic does not support them is not disclosed.

Bottom line, if you want to use an ELB with Websockets use an ALB or NLB

References

Elastic Load Balancing Features

kenlukas
  • 2,886
  • 2
  • 14
  • 25
1

I don't know why ELB doesn't support websockets. But if the vendor says they don't support it, you should just stick with that.

Hey, it's their platform.

Massimo
  • 68,714
  • 56
  • 196
  • 319