Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Socket.IO client

Project description

Python implementation of the socket.io client.

Design & goals

This implementation is inspired by the JavaScript socket.io-client implementation.

It is directly using python-engineio-client as underlying engine.io layer.

Protocol parser is copied in parts and at least largely inspired from the package python-socketio written by Miguel Grinberg.

This socket.io client is using gevent for now. This is not a strict design choice but a simplification for this first implementaion. Other asynchronous frameworks are welcome for future versions.

Example

from socketio_client.manager import Manager

import gevent
from gevent import monkey;
monkey.patch_socket()

io = Manager('localhost', 8000)
chat = io.socket('/chat')

@chat.on_connect()
def chat_connect():
    chat.emit("Hello")

@chat.on('welcome')
def chat_welcome():
    chat.emit("Thanks!")

io.connect()
gevent.wait()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-socketio-client, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size python-socketio-client-1.1.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page