Socket-style Python bindings for the Fuse UDP transport protocol
Project description
fuse-transport
Socket-style Python bindings for Fuse, an experimental UDP transport with per-stream congestion control — so a stalled bulk transfer cannot throttle unrelated latency-sensitive traffic on the same session, which is the thing QUIC's connection-wide controller cannot do.
pip install fuse-transport
# or
uv add fuse-transport
Linux only. Wheels bundle the compiled transport and its wolfSSL, so there is no compiler, no CMake, and no system library to install.
import fuse
Server
import threading
import fuse
def handle(conn):
with conn:
for message in conn: # iterates until the peer closes
conn.send(b"ECHO:" + message)
with fuse.listen(port=4433) as server:
for conn in server: # iterates incoming connections
threading.Thread(target=handle, args=(conn,), daemon=True).start()
Client
import fuse
with fuse.connect("192.0.2.10", 4433, timeout=5) as conn:
conn.send(b"hello") # str is UTF-8 encoded for you
print(conn.recv(timeout=5).decode())
Two ways this differs from a TCP socket
Messages, not a byte stream. One send becomes exactly one recv.
Boundaries are preserved (like SOCK_SEQPACKET), so you never length-prefix,
never scan for delimiters, and a partial read cannot happen.
send means delivered. It returns once the peer has acknowledged the
message, not when it was queued locally. A successful send is proof of arrival.
Retransmission, ordering, congestion control and adaptive block sizing are handled underneath.
Encryption
Set the same key on both ends for AES-256-GCM:
fuse.listen(port=4433, key="shared-secret")
fuse.connect("192.0.2.10", 4433, key="shared-secret")
A client presenting the wrong key is rejected during the handshake and never exchanges data. Note this is a pre-shared key, so there is no forward secrecy: someone who records traffic and later obtains the key can decrypt it. If that matters, run Fuse inside a tunnel that provides it.
API
| call | notes |
|---|---|
fuse.listen(port, bind="0.0.0.0", key=None, timeout=None) |
→ Listener |
fuse.connect(host, port, key=None, timeout=None) |
→ Connection |
Listener.accept(timeout=None) |
→ Connection; iterate the listener for a loop |
Listener.port |
actual port (pass port=0 to let the OS pick) |
Connection.send(data) |
bytes / bytearray / memoryview / str |
Connection.recv(timeout=None) |
→ bytes; iterate for a message loop |
Connection.peer |
(address, port) |
Connection.stats |
counters, including rtt_us |
Connection.closed |
bool |
.close() |
also via with blocks; idempotent |
Timeouts are seconds (float): None waits indefinitely, 0 polls.
Exceptions all derive from fuse.FuseError: Timeout, ConnectionClosed,
AuthError, ConfigError, MessageTooLarge.
Blocking calls release the GIL, so other threads keep running while one is
parked in recv.
Checking an install
python -m fuse selftest
Prints the version, which library got loaded, and whether encryption is available, then runs a loopback round-trip — which also confirms this kernel supports the socket features Fuse needs.
Also in this project
A C/C++ SDK with the same API (#include <fuse/sdk.h>), and a separate
higher-throughput API for moving whole files or large buffers. Both come from
the standalone installer:
curl -fsSL https://github.com/kamalkoushikd/fuse-nw/releases/latest/download/install.sh | sh
- Full SDK guide: https://github.com/kamalkoushikd/fuse-nw/blob/main/docs/SDK.md
- Benchmarks vs QUIC: https://github.com/kamalkoushikd/fuse-nw/blob/main/bench/RESULTS.md
License
MIT. Note that the bundled wolfSSL is GPLv2 (a commercial license is available from wolfSSL Inc.), so a wheel that links it is a combined work subject to the GPL when redistributed.
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 Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fuse_transport-0.1.0.tar.gz.
File metadata
- Download URL: fuse_transport-0.1.0.tar.gz
- Upload date:
- Size: 175.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d972beefda682a900ee4f3021e434a2fd0c1cd957ec88b08ada36b3552eb58e
|
|
| MD5 |
f9d3a94acaba73a1d745c1e56c3aa6f1
|
|
| BLAKE2b-256 |
fe5773da43438624ec4d65e126bad151c04b7abb0b5030dd2534aa00c614a1c7
|
Provenance
The following attestation bundles were made for fuse_transport-0.1.0.tar.gz:
Publisher:
publish-python.yml on kamalkoushikd/fuse-nw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fuse_transport-0.1.0.tar.gz -
Subject digest:
2d972beefda682a900ee4f3021e434a2fd0c1cd957ec88b08ada36b3552eb58e - Sigstore transparency entry: 2247535473
- Sigstore integration time:
-
Permalink:
kamalkoushikd/fuse-nw@46d743123fdb77975832801f837203852bc17476 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kamalkoushikd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@46d743123fdb77975832801f837203852bc17476 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fuse_transport-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fuse_transport-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 685.3 kB
- Tags: Python 3, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb051026dae91b7756dc795400a6ab66a21db1d9044cbacc357ca383274b8d32
|
|
| MD5 |
b66088234cc21b09d6e71d4667ef247c
|
|
| BLAKE2b-256 |
37ee8f98af78be621044be17231c41da03ffd82c407b255c10c5b17d26c6338e
|
Provenance
The following attestation bundles were made for fuse_transport-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish-python.yml on kamalkoushikd/fuse-nw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fuse_transport-0.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
cb051026dae91b7756dc795400a6ab66a21db1d9044cbacc357ca383274b8d32 - Sigstore transparency entry: 2247535998
- Sigstore integration time:
-
Permalink:
kamalkoushikd/fuse-nw@46d743123fdb77975832801f837203852bc17476 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kamalkoushikd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@46d743123fdb77975832801f837203852bc17476 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fuse_transport-0.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: fuse_transport-0.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 645.0 kB
- Tags: Python 3, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f07521065e4eea4e30385fad1b75901f1e15d4ec24a242258c625b991fa4541
|
|
| MD5 |
13c2458918bf3075f56ebd1212b12fd8
|
|
| BLAKE2b-256 |
e86b645f3fabf84b886e547d7f01a36d84da8e420d7715a836b3386e9a0e59d3
|
Provenance
The following attestation bundles were made for fuse_transport-0.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
publish-python.yml on kamalkoushikd/fuse-nw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fuse_transport-0.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
4f07521065e4eea4e30385fad1b75901f1e15d4ec24a242258c625b991fa4541 - Sigstore transparency entry: 2247536470
- Sigstore integration time:
-
Permalink:
kamalkoushikd/fuse-nw@46d743123fdb77975832801f837203852bc17476 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kamalkoushikd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@46d743123fdb77975832801f837203852bc17476 -
Trigger Event:
workflow_dispatch
-
Statement type: