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.
Related
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
Currently I am using the API Gateway as a kind of proxy to provide https simply
https://random-aws-name.com => http://my-domain.com
The route was $default
The integration setup is HTTP ANY -> http://my-domain.com
I am now having to setup an Websocket server on my domain that is already listening at ws://my-domain.com. I can connect directly to this socket but not using the AWS API Gateway
wss://random-aws-name.com => ws://my-domain.com
Currently I an getting unexpected error 400, using wscat
I tried to enable API gateway logging and do not see any log arrive
IMHO, AWS API Gateway is only able to provide a wss end point and route requests to HTTP backends only. If we already have a backend websocket server, I don't see an option in AWS API Gateway to perform such routing (Although I would be glad to be proven wrong as I have such a requirement myself.).
I actually tried giving wss:// url as the Endpoint URL but I got an error while deploying the API saying Invalid HTTP endpoint specified for URI
Most likely, the API Gateway you are currently using is not a WebSocket API, but rather an HTTP API or REST API. API Gateway has different flavors. You pick a flavor when you deploy. The flavor that you deployed is most likely not the flavor that supports WebSocket connections.
According to this documentation page, proxied WebSocket connections may only be one-way (note in blue box at bottom of page): https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-routes-integrations.html
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?
I have a GraphQL Apollo server running in AWS Fargate (ECS), I'm using API Gateway (HTTP proxy integration) on top. The purpose of that API is to make use of Cognito Authorizer in addition to secure SSL (HTTPS).
This is working fine as far as Graphql HTTP operations are involved (query and mutation)
However Graphql subscriptions are using websockets. The Proxy integration doesn't seem to handle the upgrade to the websocket protocol.
I've tried to define a new websocket API following this documentation: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html
But nothing seems to work for me. I've tried defining $connect, $disconnect and $default with an HTTP proxy integration to the Apollo server endpoint, but I keep getting:
Error during WebSocket handshake: Unexpected response code: 400
Is it possible to proxy an existing websocket API using Amazon API Gateway? Is HTTP proxy integration the correct integration to use?
Note: The client implementation is fine, as my subscriptions works if I put the direct url to the Apollo server websocket endpoint.
How to publish only Http service from WSO2AM?
I am receiving an empty response from the server when I access WSO2AM service from my client.
This is what I am setting for HTTP. Service is working using HTTPS but that is not desired.