Skip to main content

No project description provided

Project description

Keeper PAM WebRTC for Python

A high-performance WebRTC implementation for Python, written in Rust for maximum efficiency and reliability.

Description

keeper-pam-webrtc-rs provides Python bindings to a Rust-based WebRTC implementation, allowing for:

  • Real-time data communication via WebRTC data channels
  • Peer connection management
  • ICE candidate handling
  • Cross-platform compatibility (Linux, macOS, Windows, Alpine)

This package is designed to be used with Keeper Gateway and Keeper Commander. It serves as a lightweight, focused replacement for aiortc, tailored specifically for Keeper Security's internal products and use cases.

Note: This package is intended for internal Keeper Security products and is not being actively advertised for general use.

Installation

pip install keeper-pam-webrtc-rs

Usage

import keeper_pam_webrtc_rs

# Initialize WebRTC peer connection
config = {"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
pc = keeper_pam_webrtc_rs.PyRTCPeerConnection(
    config, 
    on_ice_candidate=lambda c: print(f"ICE candidate: {c}"), 
    on_data_channel=lambda dc: print(f"Data channel: {dc.label()}"),
    trickle_ice=True,
    turn_only=False
)

# Create offer
offer = pc.create_offer()

# Create data channel
dc = pc.create_data_channel("example-channel")

# Send data
dc.send(b'Hello WebRTC!')

# Set message handler
def on_message(data):
    print(f"Received: {data}")
dc.on_message = on_message

# Close when done
pc.close()

Features

  • Async-first design with Tokio runtime integration
  • Optimized for performance and reliability
  • Cross-platform compatibility
  • Built with abi3 for maximum Python version compatibility (Python 3.7+)
  • Comprehensive WebRTC functionality

WebRTC Configuration

TURN-only Mode

The WebRTC implementation supports a "TURN-only" mode which forces all WebRTC traffic through TURN servers rather than attempting direct peer-to-peer connections. This can be useful in the following scenarios:

  • When you need to guarantee connectivity through restrictive firewalls
  • When you need to ensure consistent network behavior
  • For regulatory compliance requirements that mandate traffic through specific servers
  • When troubleshooting WebRTC connectivity issues

To enable TURN-only mode, set the turn_only parameter to True when creating a peer connection:

# Regular mode (uses all ICE candidate types)
peer = keeper_pam_webrtc_rs.PyRTCPeerConnection(
    config, on_ice_candidate, on_data_channel,
    trickle_ice=True, turn_only=False  # Default is False
)

# TURN-only mode (only uses relay candidates)
peer = keeper_pam_webrtc_rs.PyRTCPeerConnection(
    config, on_ice_candidate, on_data_channel,
    trickle_ice=True, turn_only=True
)

Note that TURN-only mode requires properly configured TURN servers in your ICE server configuration:

config = {
    "iceServers": [
        {
            "urls": ["turn:your-turn-server.example.com:3478"],
            "username": "your-username",
            "credential": "your-password"
        }
    ]
}

Performance Considerations

TURN-only mode forces all media traffic through relay servers, which can introduce:

  • Higher latency compared to direct connections
  • Increased bandwidth costs for TURN server operations
  • Potential bottlenecks if TURN servers are overloaded

Use this mode only when necessary, and ensure your TURN servers are properly scaled for your application's needs.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-win_amd64.whl (6.5 MB view details)

Uploaded CPython 3.7+Windows x86-64

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.6 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_11_0_arm64.whl (6.8 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl (7.1 MB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d83177deeaeefece116de126b42ed652f8a9a33c3383c894c7e50065f36db267
MD5 aacaaf285405f9f7609cbb87cf6c1372
BLAKE2b-256 b374519bb44f8c2b0e9c913b599cf851a1bda3bf873e01cbea2c5216519fa703

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7b8dca0615441fbf73792c3c2d60806f059603889f20022cf778d030ad76b1f9
MD5 210bb1a186264dfddefa0d9274ef6f1d
BLAKE2b-256 f8fc58a63c88b784beb01cb1005665bc155579657d9f196be0bf35fbfce087d5

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c428a93c3e51a7b58dc4864624b73e18638eaa05f040bb9e499da6291ef7b61
MD5 11da6f8c7a06457086c78488e6e1ac54
BLAKE2b-256 44b6014508e39871021e251fb9b1182c259ad4026af9433113fe97064df0ef29

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9b6c6ec4ed76d5ca7bde0a3a04427dfce65a5c2ac7b124350be779d237183f45
MD5 b298dc632287c7fd370dac306a472377
BLAKE2b-256 0dc728575ead2b34f56df04850736368007a7b4375acb45f8802bd47ef3ef417

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 213915503b687701b3edcb926a49e62f723641771cfd471719e733d598d2ed27
MD5 561d36cec9512b5c81955df5b569d379
BLAKE2b-256 9cfcbb1ea2695232fe64d488faef571078d5ee33f3de04e73f4f852fe66de25f

See more details on using hashes here.

File details

Details for the file keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e61ec37b53851eb132149d201cbeee2d52d0b2ce335425b984ffb39c6d052352
MD5 d14833b22fe14024a6070bdcebbcf42e
BLAKE2b-256 de8f153bfd25671c14a4e300a84fc90d6ea89a89ea9273d7de7a1d9f5115df6c

See more details on using hashes here.

Supported by

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