Skip to main content

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.

Source Distribution

python-socketio-client-1.1.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file python-socketio-client-1.1.tar.gz.

File metadata

File hashes

Hashes for python-socketio-client-1.1.tar.gz
Algorithm Hash digest
SHA256 373c856bd9698c575e68970c098b6261092b22eb2d69001fe22b6bedf2e17c4a
MD5 5e79badcc9b70ebd406e7d04c23c455d
BLAKE2b-256 cc41f80606edf36c3f57068728077db52393e96323d767fd410b7ee3b3031df0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page