Can API Gateway be used as Websocket client?

0

Hello,

Is it possible to initiate a WebSocket connection from AWS Gateway, or otherwise set up a Serverless/lambda-based connection to an AWS-external Websocket interface? And if so, how?

Any API Gateway/Websocket question/article/tutorial/example I've come across is about hosting a WebSocket API and having clients connect to it, and not the other way around.

The only related question Ive seen is this one but it has not been answered yet: https://stackoverflow.com/questions/69173955/can-i-connect-to-websocket-api-as-a-client-from-aws-api-gateway

Any pointers or help would be much appreciated

1 Respuesta
0
Respuesta aceptada

No, API Gateway only supports incoming web sockets (and also REST) connections. If you want to initiate a connection to some other service, you will need to write code, using some web sockets library, that runs in a container, to establish the connection. You can't use a Lambda function to run this code, unless you expect the connection to be short lived (up to 15 minutes).

profile pictureAWS
EXPERTO
Uri
respondido hace 2 años
profile picture
EXPERTO
revisado hace 4 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas