A tiny nameko service that demonstrates usage of websockets, designed to test that websocket connections traverse an ELB correctly.
- git clone [email protected]:246057831ebb76dbd8c5.git
- create new virtualenv (optional)
- pip install -r requirements.txt
- update config file (optional)
- nameko run service --config config.yaml
The two config variables are the "public" hostname and port. They're injected into the javascript so need to be accessible to the client.
Launch the service and open a browser pointing at it. The websocket connection should immediately connect, but will not reconnect if the connection is broken. Every 10 seconds the service will send a "ping" message to all connected clients. The "ping" message uniquely identifies the service instance from which it originated.
The connection should be stable even through ELB. When ELB is load-balancing more than one service instance, the client should remain connected to the first instance it connected to.
Assuming this works, we should subsequently test that the connection remains active even after reducing the frequency of the "ping" messsages to less than the ELB timeout. If this doesn't work, we'll have to introduce a heartbeat.