Skip to main content
The Python binding supports desktop and gateway processes. Its peer-stream transport uses TCP over an existing IP network; it does not create a Wi-Fi Direct network. Internet relay and BLE integrations have separate platform requirements.

Build v0.27.0

Install Python 3.10+, the Rust toolchain and the native build prerequisites for your OS. Generate bindings and the native library from the same revision.
The default MLS storage uses the OS keyring. Provision a working keyring backend on the target host. state_root is a separate, application-owned directory for persisted protocol state. Preserve both across restarts.

Start a local peer

Save this as local_peer.py and run it from the activated environment. Each host uses its own state directory and keyring. Allow TCP port 7878 and DNS-SD on the local network, or configure an explicit peer endpoint instead of discovery.
Run it on both hosts. The event stream identifies discovered peers. Use the resulting address when calling pm.send_message(peer_address, content) in your application. Binding 0.0.0.0 listens on every interface; use a specific interface address when the host spans networks.

Add an internet relay

Enable internet_enabled and configure pm.internet with the provisioned relay URL. Call pm.internet.set_auth_token(auth_token) before pm.internet.start(). Without an explicit token, the v0.27.0 manager falls back to the profile string, which is forgeable and is not a production authentication policy. See relay access. A relay connection is an additional path; it does not replace local transport or automatically upload business records into your backend.

Version boundary

The v0.27.0 example uses the OS keyring. Built-in sealed file-store initialization exists in newer SDK source and has a different storage setup; do not copy those unreleased options into a v0.27.0 deployment. Keep the binding and native-library revision together when qualifying that path. See the Python source and upgrade guide. wifi_direct_enabled=True enables the existing-IP peer-stream slot. Python BLE uses bleak for central and bless for peripheral. bless is installed by default except on Windows; the SDK starts the peripheral when BLE is enabled. Qualify platform radio support and permissions.