from flask import Flask, render_template
from flask_socketio import SocketIO, emit

app = Flask(__name__)
socketio = SocketIO(app)


@app.route('/')
def index():
    return render_template('index.html')

@socketio.on('connect')
def test_connect():
    emit('after connect',{'data':'lets dance'})

@socketio.on('end')
def submit(message):
    print(message)

if __name__ == '__main__':
    socketio.run(app,host='0.0.0.0')
from flask import Flask, render_template
from flask_socketio import SocketIO, emit

app = Flask(__name__)
socketio = SocketIO(app)


@app.route('/')
def index():
    return render_template('index.html')

@socketio.on('connect')
def test_connect():
    emit('after connect',{'data':'lets dance'})

@socketio.on('end')
def submit(message):
    print(message)

if __name__ == '__main__':
    socketio.run(app,host='0.0.0.0')