1 Answer
- Newest
- Most votes
- Most comments
1
API Gateway supports web sockets only from the client to the gateway itself. From the gateway to the backend (ECS behind NLB in your case), API gateway sends regular HTTP requests, i.e., for every messages API Gateway receives on the socket, it sends an HTTP request to the backend with the message in the payload. When the backend wants to send a message to the client, it sends an HTTP request to the @connections end point and ask the gateway to send the message to the client.
If you want a websocket all the way to your backend, you can't use API Gateway and you need to expose your NLB/ALB.
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 3 years ago