miguelgrinberg / flask-sock

Modern WebSocket support for Flask.
MIT License
272 stars 24 forks source link

Adding a clock from the server #44

Closed gbrault closed 1 year ago

gbrault commented 1 year ago

I just added few lines of codes in the server.py and add a span in the index.html.

Of course it's a bit bigger than the original, but still simple enough to grasp the concept.

It shows the ws can really be a two way channel

miguelgrinberg commented 1 year ago

Thanks. Unfortunately I cannot accept this change due to a few problems:

gbrault commented 1 year ago

No issue @miguelgrinberg I understand the points. My purpose was to provide an example of ws communication which was unattended from the client perspective.

miguelgrinberg commented 1 year ago

@gbrault Yes, and I am okay with the idea of adding a separate example that shows how to send from server to client. Mixing this with the echo example makes the code more difficult to understand.

gbrault commented 1 year ago

Totally agree! Do you want me to make a proposal? (and an according modified pull-request)?

miguelgrinberg commented 1 year ago

Yes, feel free to submit a new PR with a separate example. Thank you!