-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check this if you run into issues with execute-api WebSockets #61
Comments
@atlascoder your url does not look correct '@connections' seems wrong (looks similar to something used in aws cloudformation, but not a correct api gateway path) |
Hi @okigan , actually this is correct url for WebSocket API of APIGateway: https://docs.aws.amazon.com/en_us/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html |
Oh this is something new (to me :), will require more digging |
Yes, your tool is convenient and support for WebSocket url would be great |
Ooops, I did not realize my tool made into into official AWS docs! 🤣 |
@atlascoder ok, this is getting interesting, I need more information to reproduce this. Paste your setup for the route, and how you’ve setup the request and response template/mapping/etc: https://docs.google.com/document/d/1-5u7A-bqmYldUoTBy6rMsO4rJC_kQzaHjHs__1yfmHY |
@okigan, sorry, it's not so straight.. I create WebSocket connection from Qt app and then I take session ID and try to send data to the socket with POST request. To reproduce this you can create any WebSocket-type API and a resource that does not require authorization. The resource should have Lambdas connected to If I understood right the aim of your tool - it can make requests using AWSCredentials from env, so, if a current user will be authorized to post data to websocket - the POST requests like https://api_endpoint/stage/@connection/connectionId should send content to the connection (while it is open) |
It’s more about that back end setup (not the qt setup), I tried to follow https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-wscat.html. But effectively it returns an error that request/response templates are not setup. So I need more insight how to setup the WebSocket api (that works👻) |
@atlascoder I think i have a repro (instead of mocking created a simple lambda), try out this branch confirm that it works for you as well: #64 |
ok, i've figured it out, fantastically complicated, strap on your seatbelts! This will require usage of both tools: wscat and awscurl.
code for the connected lambda function:
|
@okigan cool! So, everything is needed is to make percent-encoding... Obvious! |
I'll check the branch #64 and reply |
@okigan did you use WS API without authorization? Or how have you used |
@atlascoder without, see updated snapshot above |
OK, @okigan thank you! |
@okigan, I confirm - it works! Thanks a lot!! |
@okigan thanks a lot 💯 , I was really struggling to get |
I've made a proposal to AWS to update documentation, all encouraged to review & comment on the draft. proposal draft: https://docs.google.com/document/d/1G_vyFBV7d_3QS4dcaRqexLa8magZm7CsPAuivGTRip8/edit?usp=sharing |
hmm, might be simpler to make a PR for https://github.com/awsdocs/amazon-api-gateway-developer-guide/blob/master/doc_source/apigateway-how-to-call-websocket-api-connections.md |
This worked for me, using the https://github.com/legal90/awscurl tool. I have not been able to make messaging clients work with the Go SDK, but this shows the APIGW works. |
I got error when trying to execute:
Also tried:
and
The error:
The text was updated successfully, but these errors were encountered: