Expand description
Reverse-initiated, multiplexed services over QUIC.
quic-reverse is a library that enables servers to initiate streams back to clients
over an existing QUIC connection. This is useful for scenarios where:
- Clients are behind NAT and cannot accept incoming connections
- Edge devices need to expose services to a central server
- Reverse tunneling is required without opening inbound ports
§Architecture
The library sits atop an existing QUIC connection and adds:
- An explicit control plane for stream lifecycle management
- Reverse-initiated stream semantics
- Service multiplexing via service identifiers
- Well-defined negotiation, backpressure, and error handling
§Example
ⓘ
use quic_reverse::{Session, Config, Role};
// Wrap an existing QUIC connection
let session = Session::new(connection, Role::Client, Config::default());
// Start the session (performs negotiation)
let mut handle = session.start().await?;
// Open a reverse stream to a service
let (send, recv) = handle.open("ssh", Metadata::Empty).await?;Structs§
- Config
- Configuration for a quic-reverse session.
- Features
- Feature flags negotiated during
Hello/HelloAckexchange. - Negotiated
Params - Result of successful negotiation.
- Open
Flags - Flags for
OpenRequestmessages. - Quinn
Connection - Wrapper around a Quinn connection implementing the
Connectiontrait. - Quinn
Recv Stream - Wrapper around a Quinn receive stream implementing the
RecvStreamtrait. - Quinn
Send Stream - Wrapper around a Quinn send stream implementing the
SendStreamtrait. - Service
Id - Identifies a logical service for multiplexing.
- Session
- A quic-reverse session over a QUIC connection.
- Session
Client - A high-level, cloneable client for quic-reverse sessions.
- Session
Handle - Active session handle with control stream access.
- Stream
Bind - Stream binding frame sent on data streams.
Enums§
- Client
Event - Events delivered to the event handler callback.
- Close
Code - Close codes for
StreamClosemessages. - Control
Event - Events that can occur on the control stream.
- Error
- Errors that can occur during session operations.
- Metadata
- Metadata attached to stream open requests.
- Reject
Code - Reason codes for rejecting an
OpenRequest. - Role
- Role in a quic-reverse session.
- State
- Session lifecycle state.
Traits§
- Connection
- Abstraction over a QUIC connection.
- Recv
Stream - Abstraction over a QUIC receive stream.
- Send
Stream - Abstraction over a QUIC send stream.