Skip to content
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

Deploy on AWS with Lambda #7

Open
rafasashi opened this issue May 11, 2019 · 4 comments
Open

Deploy on AWS with Lambda #7

rafasashi opened this issue May 11, 2019 · 4 comments

Comments

@rafasashi
Copy link

Is it possible to deploy it to AWS with Lambda and API Gateway?

@vardius
Copy link
Owner

vardius commented May 11, 2019

Absolutely, however in case of this example to work there, singling server would need to be updated a little bit, to meet requirements of AWS Lambda and API Gateway. The state has to be persisted somewhere, in a database, so you can track each of the connected clients.

https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/

The application is composed of the WebSocket API in API Gateway that handles the connectivity between the client and servers (1). Two AWS Lambda functions react when clients connect (2) or disconnect (5) from the API. The sendMessage function (3) is invoked when the clients send messages to the server. The server sends the message to all connected clients (4) using the new API Gateway Management API. To track each of the connected clients, use a DynamoDB table to persist the connection identifiers.

@rafasashi
Copy link
Author

Thank you very much for the info Rafal.

And appart from Lambda, API Gateway, RDS database (or SNS) we do not need any streaming server in the middle because it is peer to peer right?

@vardius
Copy link
Owner

vardius commented May 12, 2019

Yes, the only thing you need is a signalling server (in this case it would be API Gateway)

@vardius
Copy link
Owner

vardius commented May 24, 2019

I set up some simple explanation how you can implement your own signaling channel
https://github.com/vardius/peer-data/wiki/Signaling#custom-signaling-channel

let me know if it need improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants