This is a Serverless project which creates a websocket chat backend. It's quite basic, but supports some standard features including setting a nickname, multiple channels, and broadcasting messages to channel members. The coolest this is that this is entirely serverless and in Python!
This can all be deployed with AWS SAM.
$ sam build
$ sam deploy --guided
The final output will be a wss
endpoint which you can connect to:
---------------------------------------------------------------------------------
Outputs
---------------------------------------------------------------------------------
Key WebSocketURI
Description The WSS Protocol URI to connect to
Value wss://abcd123.execute-api.us-west-2.amazonaws.com/Prod
Use wscat
to connect and test:
- Install
wscat
by just runningyarn
- In two different terminals:
./node_modules/.bin/wscat -c wss://YOUR_WS_ENDPOING
- Now type a meesage and hit enter...you'll see messages from one window pop up into another.
/name bz
- Change your display name tobz
/channel random
- Change to therandom
channel. Default channel isgeneral
/help
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.