Home › Forums › AWS › AWS Certified Solutions Architect Professional › Use ALB or NLB for Websocket? › Reply To: Use ALB or NLB for Websocket?
-
Hello Everyone,
Thank you for taking the time to share your perspective. This is a great technical discussion, and I appreciate the detailed reasoning! Let me clarify a few key points to address the confusion around ALB vs NLB and their behavior with WebSockets and custom ports.
First, a quick correction on terminology: the Application Load Balancer (ALB) operates at Layer 7 (Application Layer) of the OSI model, not the presentation layer. It is designed to process HTTP and HTTPS requests and natively supports WebSockets only when the handshake occurs over HTTP/S (
ws://orwss://). While ALBs can indeed listen on ports other than 80 or 443, those listeners must still carry HTTP/S traffic. If the application uses raw TCP connections or non-HTTP protocols, an ALB cannot process that traffic.In contrast, the Network Load Balancer (NLB) functions at Layer 4 (Transport Layer) and can forward any TCP or UDP traffic on any port. It doesn’t inspect application-layer data — it simply passes connections through. In this question’s scenario, the Virtual Learning Environment (VLE) uses WebSockets on port 5000 and another feature communicating over port 8080, both of which are non-standard TCP ports with no clear indication of HTTP/S usage. Because of that, the most reliable and compatible solution is to use an NLB, which can handle both custom and potentially non-HTTP traffic seamlessly.
If you have further questions or need additional clarification, please don’t hesitate to contact us.
Best,
Irene @ Tutorials Dojo