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回答
0
承認された回答

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
エキスパート
Uri
回答済み 2年前
profile picture
エキスパート
レビュー済み 4ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ