2021-01-10T23:29:01Z

Learn Socket.IO with Python and JavaScript in 90 Minutes!

The video below contains a complete 90 minute Socket.IO course using Python and JavaScript.

This is the list of chapters, each with a link to the code for each part of the tutorial:

6 comments

  • #1 Lawrence said 2021-04-06T01:40:54Z

    Hi Miguel, loving the content, I have a query on sockets use. If I have a user selecting a date range and the data is fetched from database using a loop in a class method, one day at a time, would this be a good use case for sockets or would you recommend another approach?

  • #2 Miguel Grinberg said 2021-04-06T10:55:46Z

    @Lawrence: you may want to also consider streaming for your use case, which is easier to implement.

  • #3 Braian said 2021-04-27T03:09:50Z

    Hi Miguel,

    I managed to connect to a websocket server to get information stream and at the same time, using socket io to deliver that information in real time with no luck. Do you know if it’s possible to use Flask server as a client to capture the info and then send it to clients through socket io in real-time?

    Thanks

    Braian

  • #4 Miguel Grinberg said 2021-04-27T22:09:50Z

    @Braian: if you have code to connect to this WebSocket service in Python you should be able to use it inside a Flask application, maybe in a background thread so that it does not interfere with the server.

  • #5 Rupesh Shah said 2021-05-11T22:11:59Z

    Hi Miguel,

    I have NodeJS socket.io server with Python native as socket.io client. I am using python-socketio asyncClient. Server uses redis adaptor. In python code, I just have print (data) in event handling. What I have noticed is that python client loses some events (I am trying approx 3 seconds apart) sent by the server as I don't see the output of print (data) on the console. I would like to mention that I do see the message in redis-cli though and that means server is sending the message fine but Python client is unable to retrieve it for some reason. What could be the problem?

  • #6 Miguel Grinberg said 2021-05-12T08:47:30Z

    @Rupesh: If you think the Python client has a bug, then see the troubleshooting section of the documentation to learn how to generate logs that cover the problem. Then file an issue on GitHub with those logs. For this issue it may also be necessary that you capture logs from your Socket.IO server (looking at Redis is not enough to ensure a message was sent).

Leave a Comment