shubham1172 / remote-play

Media controller for PC
MIT License
31 stars 28 forks source link

added Websockets for touchpad control #15

Closed wahwic closed 3 years ago

wahwic commented 3 years ago

Fixes issue #1

shubham1172 commented 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 ?

wahwic commented 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 ?

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. 👍🏻

shubham1172 commented 3 years ago

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