RackioSocket

A Rackio extension to add a SocketIO Server to Rackio


License
MIT
Install
pip install RackioSocket==0.9

Documentation

rackio-socket

A Rackio extension to add a SocketIO Server to Rackio

Installation

pip install RackioSocket

Usage

from rackio import Rackio
from rackio_socket import RackioSocket

app = Rackio()

RackioSocket(app, 5005)

app.run(8028)

SocketIO Client

After running your application it will serve the SocketIO through the 5005 port.

var socket = io('http://localhost:5005');

Adding new events to your applications

You can add your custom events using the decorator pattern.

rs = RackioSocket()

@rs.event
def custom(sid):
    print("custom event " , sid)
    rs.emit("response", {"message": "this is the custom response"})


@rs.on("another custom")
def another_event(sid, data):

    response = processing(data)

    rs.emit('response', response)