rtcplogin
rtcplogin is a simple and powerful Python module for building real-time communication applications. Inspired by the rtcplogin standard, it allows you to handle audio, video, and P2P data with low latency and minimal syntax.
Features
- P2P Communication: Direct data exchange between clients without a central server.
- Audio & Video: Real-time transmission with low latency.
- Data Channels: Send and receive text or JSON messages instantly.
- Event Handling: Simple callbacks for
on_connect, on_message, on_disconnect.
- Secure: Built-in DTLS/SRTP encryption.
- Interoperable: Compatible with browsers and other rtcplogin clients.
Installation
pip install rtcplogin
Basic Usage
Create a client and connect
from rtcplogin import rtcploginClient
client = rtcploginClient(username="Alice")
@client.on("message")
def handle_message(sender, content):
print(f"{sender} says: {content}")
client.connect("bob_peer_id")
client.send("bob_peer_id", "Hi Bob!")
client.listen()
Audio/Video example
client.connect_audio()
client.connect_video()
Use Cases
- Real-time audio and video chats
- P2P multiplayer games
- Streaming and data sharing
- Collaborative tools (drawing, shared documents)