Python Forum
Flask and Websockets == True?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask and Websockets == True?
#1
Hi!

I was wondering what the best practice was for a Flask web app or API service with web sockets?

Maybe something like the below would be great!

@app.route("/")
def index_handler():
room = web_socket_connect()
return render_template("index.html", room)
Reply
#2
(Apr-21-2019, 04:13 AM)rxndy Wrote: I was wondering what the best practice was for a Flask web app or API service with web sockets?
I would say using flask-socketIO can be looked at best practice.
So flask-socketIO is made to simplify the process of using of websockets in Flask.
Reply
#3
Dude I will look into that!

Thanks! Dance
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Listen TCP and send data to websockets neoboby 3 3,018 Feb-13-2023, 09:47 PM
Last Post: Vadanane
  Asyncio | Websockets - general problem starting the server dreamer 5 3,255 Oct-26-2022, 11:55 AM
Last Post: dreamer
  websockets help :/ kimblee 3 5,533 Feb-15-2021, 01:26 AM
Last Post: kimblee
  Slow websockets server -> client pattagghiu 0 2,397 Sep-17-2019, 09:28 AM
Last Post: pattagghiu
  Send Pressure sensor data to IoT platform using WebSockets in Python barry76 3 4,631 Mar-12-2019, 09:48 AM
Last Post: barry76

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020