Added libs
This commit is contained in:
30
noSys/noSysSocketio.py
Normal file
30
noSys/noSysSocketio.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from flask import Blueprint, make_response, request, jsonify, session, request
|
||||
from flask_socketio import SocketIO, emit, join_room, leave_room
|
||||
|
||||
from libs.api.eventsSocketio import EventsSocketio
|
||||
|
||||
import os, json
|
||||
import logging
|
||||
|
||||
class HandlerSocketio(EventsSocketio):
|
||||
def events(self):
|
||||
@self.socketio.on("message", namespace=self.namespace)
|
||||
def on_message(*args, **kwargs):
|
||||
print('NoSys Message',args, kwargs)
|
||||
self.emit("message", f"Message from Nosys {args[0]}")
|
||||
|
||||
@self.socketio.on("ola", namespace=self.namespace)
|
||||
def on_test(*args, **kwargs):
|
||||
print('Zecho ola',args, kwargs)
|
||||
self.emit("ola",f"Ola from Nosys {args[0]}")
|
||||
|
||||
|
||||
|
||||
def send_test(self, message):
|
||||
self.emit("test", message)
|
||||
|
||||
def emit_new_user(self, user):
|
||||
self.emit("newUser", user)
|
||||
|
||||
def emit_new_peer(self, peer):
|
||||
self.emit("newPeer", peer.id)
|
||||
Reference in New Issue
Block a user