You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A typical websocket server requires an ability to speak a binary protocol over an upgraded
http protocol connection. By its nature, that requires the operational capability to maintain a
long lived persistant connection with many connected clients.
A server with a sturdy security posture should
also provide a means of encrypting information passed across network connections. Secure websocket connections require additional handshake procedures which requires additional binary protocol extensions that you are responsible for.
Serverless websocket applications
API Gateway replaces the need for you to write and operator traditional websocket servers. API Gateway exposing a tls (wss) websocket endpoint and manages persistent connections for you freeing you up to focus application specific details.
Your application need only implement functions to be invoked to specific lifecycle events called "routes". A few special routes are $connect$disconnect and $default which represent a new client connecting, an existing client disconnecting, and an unmapped request route respectively. You are not responsible for maintaining a network connections but you are responsible
for maintaining connection identifiers. Managed serverless data stores like Dynamo DB make storing this trivially simple.
You can also route based on a request pattern. By default, with Serverless framework, it's expected connected clients send the server JSON payloads containing an "action" field which a handler gets routed to based on its value. This example application routes on an action called "send".
Doug Tangren (softprops) 2019
About
⚡🏗️ template for new aws lambda websocket serverless rust apps