Skip to content

Instantly share code, notes, and snippets.

View miusorin's full-sized avatar
💻
Typing...

Sorin Miu miusorin

💻
Typing...
View GitHub Profile
@pgjones
pgjones / app.py
Last active January 15, 2020 15:00
flask-sockets example requires: Flask, Flask-Sockets, Flask-SocketIO
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template_string
from flask_sockets import Sockets
import json
app = Flask(__name__)
sockets = Sockets(app)
template = """