Creating a Chat App With Flask-SocketIO

I introduce Flask-SocketIO in this video by creating a simple chat app. Lookout of for other SocketIO videos where I create more complicated apps.

To download the cheat sheet, go here:

Get the code here:

Web Development Courses:
Flask Cheatsheet:

Google Plus:


(Visited 33 times, 1 visits today)

You might be interested in

Comment (21)

  1. I am trying to create a live chat similar to customer-agent chat, and i am failing to create different instance of socketio for customer as well as agent side.
    Basically, when user logs in, he is entered into a room with a uuid, then the function should check if an admin is already logged on, and on basis of that, if an admin is online, the socket from admin side is initiated somehow making him join the same room. However i am not able to do the same using flask_socketio. Any help would be appreciated.
    I have looked into nodejs, where they are just storing the socket variable from where the connection is being made, during admin login and using the same socket variable stored in a array and initiating a join_room from it for the admin side while the user initiates that particular function.

  2. When I tried this on my localhost, it worked perfectly fine. However, I tried using it online ( and it was a) inconsistent (sometimes it would should the 'user has connected,' sometimes not) and b) the messages never re appeared. I did some testing and found that the 'user has connected' was sent to the python file, but not sent back (I included the send(msg, broadcast=True) in my code), and I also found that anything the user typed wasn't even sent back to the python file. Any help?

  3. Hi… I'm relatively new to SocketIO (but not python)… and I was wondering if you could make a simple tutorial on a little server-client game (multiplayer) (like scissor paper rock or something) – maybe command line only (without the html files and everything…)
    just so that we can see how it all works under the hood (without all the pre-made js scripts)

    Thanks in advance, and great tutorial!

  4. hey thanks for this video, i'm trying to create a client/server app with a database in AWS, in which i can get data from the AWS and publish to the webapp, i'm kind stuck in the socket-io thing using flask, could you or any one here help


Your email address will not be published. Required fields are marked *