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.1-cp37-abi3-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.7+Windows x86-64

keeper_pam_webrtc_rs-0.2.1-cp37-abi3-musllinux_1_2_x86_64.whl (8.2 MB view details)

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

keeper_pam_webrtc_rs-0.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.1 MB view details)

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

keeper_pam_webrtc_rs-0.2.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

keeper_pam_webrtc_rs-0.2.1-cp37-abi3-macosx_11_0_arm64.whl (7.2 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

keeper_pam_webrtc_rs-0.2.1-cp37-abi3-macosx_10_7_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2d6f99f79c904466315d62806c017e297be0bb86687a4df388058affc19a18f9
MD5 d69ca58972bed4702d419120b59cd4a1
BLAKE2b-256 e1586f698af6e7af3c4a4c086d38a592d7cd7e0c83728a75396bd26f04a6a69c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0dc0e6d6a0e46320e4550e8997ae1b85d3a7d7a23ef89085c45907540e0c3997
MD5 c5f13c1814f7e48660f4120104494431
BLAKE2b-256 a9a807f8e134849e471db950be6ef1bd329ee57f9c93919d0e9da734c8110359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aacbc9eb922fe875f3b30bee00cd167eb212b722de8228ff1a1a2b08b49cda46
MD5 b60b1049c172fcf0de9d31a78aeba4b0
BLAKE2b-256 0eef4a70d9d7a0312ec14434ce6c17ccacc29aaaccef9e303fde430b882392fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3e177b0a47c92078e2fb66da5340c43575f5bc420602df77e5331a66cac4f2de
MD5 ce45ba208ac67a801984454de0df75f6
BLAKE2b-256 a958be8339dcde34f3a805da99e921a214f64a1635f9bb4ab55a4230619b83d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f853de766dfbf99a51038e5450ada46e1b17f43974e17a6812fed129e23b756
MD5 e1370dafb13fd824042ee4c0d564b487
BLAKE2b-256 25727398e55139b0a202f9536ce047613fb20210d95ddcd39fe0dc45804854d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keeper_pam_webrtc_rs-0.2.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5ea18a2ef26d42c59c2b7ef4067a1db6e57bd1fb9a55e87a5c70c38e7079b56a
MD5 6e96601bd6eeab6667d16f4f05cdbc46
BLAKE2b-256 3f004f41ef0073133711ae17c1732efb9d0fb2ffc20a90e87b237615c8911970

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