Closed wahwic closed 3 years ago
I am thinking that we should limit the number of maximum clients on a server to a configurable value, maybe defaulting to 1? We can use a pattern similar to the official docs https://fastapi.tiangolo.com/advanced/websockets/#handling-disconnections-and-multiple-clients to manage multiple clients and subsequently limiting them. This would protect the server from getting too many requests. Thoughts @wahwic ?
I am thinking that we should limit the number of maximum clients on a server to a configurable value, maybe defaulting to 1? We can use a pattern similar to the official docs https://fastapi.tiangolo.com/advanced/websockets/#handling-disconnections-and-multiple-clients to manage multiple clients and subsequently limiting them. This would protect the server from getting too many requests. Thoughts @wahwic ?
Yes, maximum one connected client does make sense in this app. The docs give a good base for this. Will tinker with it when I find some time. 👍🏻
Nit: let's run pylint on the main.py - default linter in vscode
index.js also needs linting - any general linter should fix the spacing issues.
This makes me want to add linting as pre-commit hooks to the repository. #16
Fixes issue #1