AWS Gateway proxy to an existing WebSocket server - amazon-web-services

thank you for reading this question.
what is the way to use AWS API Gateway to proxy communication to a WebSocket server running on EC2?
I tried HTTP/REST and WebSocket with no success.
thank you

Related

Can I connect to websocket API as a client from AWS API gateway

I am trying to connect to Binance WebSocket API with the base endpoint: wss://stream.binance.com:9443
I want to utilize AWS Lambda to respond to certain price targets.
I looked at the AWS API gateway WebSocket documentation but it seems to be that we can use API gateway to host the Websocket API but not to connect as a client to another API.
Am I right in assuming that? Because I only see the tutorials and blog posts about how to create a WebSocket API but not how to connect TO a WebSocket through API gateway. Or is it because connect to WebSocket through API gateway is not the correct approach?
If the latter is the case could you please guide me on how I can utilize the AWS service to achieve this?
Very much appreciated
EDIT:
I found this question that was asked a few years back but at that time, it seems no solution existed. Hoping this changed now --> Is it possible to subscribe to a WebSocket in a serverless fashion using AWS?

How to connect websocket API with AWS Websocket API gateway

We have implemented WebSocket which is running on a ec2 machine and from public ip it is working fine.
We want to map this WebSocket path with API Gateway so that our public ip will not be visible to others and we can run through in the same manner in which we are running our other apis which is based on HTTP protocol.
But the problem is we don’t have any idea to map external WebSocket address with API Gateway.
You can map the websocket endpoint using the http(s) protocol in your api gateway and enable session stickyness in your loadbalancer.
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html

Why API Gateway websocket publish a https connection?

I am using AWS API Gateway websocket endpoint and I see there are two endpoints created after deploy. One is https the other is wss. I can use websocket client to connect to my service via the websocket endpoint. I wonder why it creates a https endpoint.
I think this is to use #connections commands in your backend service.
With the https endpoint:
Your backend service can use the following WebSocket connection HTTP requests to send a callback message to a connected client, get connection information, or disconnect the client.

AWS Api Gateway websocket to custom wensocket server in ecs behind ALB

I want to integrate websocket api to my ecs managed websocket api running behind ALB. Only http connections are allowd, so i am getting 426 error as upgrade required. How can i send websocket request from api gateway to ALB?

HTTP endpoint for AWS Managed Kafka?

Can a HTTP endpoint be setup with AWS's Managed Streaming for Apache Kafka (MSK)? With which we can send data using HTTP POST? We can't use the AWS SDK because the client is very thin (it is our CDN actually) and it can only do simple HTTP requests like cURL/wget.
You can use the KAFKA REST Proxy within the same VPC where you are running MKS , quoting from MSK FAQ's . Refer to the Kafka REST Proxy docs for the APIs
REST Proxy: A REST proxy can be installed on an instance running within your VPC. REST proxies allow your producers and consumers to communicate to the cluster through HTTP API requests.