browser-go-api/websockets/socket.py
2019-10-07 16:28:11 -07:00

17 lines
No EOL
359 B
Python

from app import socketio
from flask_socketio import send, emit
@socketio.on('connect')
def handle_connection():
print('''
wow, there was a socketio connection!
cool
''')
send({'data':'connection'})
@socketio.on('message')
def handle_message(message):
print(message)
emit('message return', {'data':'a message was sent'})