Skip to content

Conversation

@mfahampshire
Copy link
Contributor

@mfahampshire mfahampshire commented Jan 12, 2026

Part 2 of breaking #6129 into smaller chunks.

This is the second (so should only be looked at after #6318 is merged and this branch is rebased, removing the first chunk of commits).

This contains the nym client -> nym client Rust SDK stream wrapper, and the stream wrapper for the Rust SDK which uses gateway IPRs to send IP packets through the mixnet.


This change is Reviewable

Introduces a TCP-socket-like abstraction for mixnet communication:
- MixSocket: unconnected socket that can be connected or used as listener
- MixStream: bidirectional stream with send/recv methods
- MixStreamReader/MixStreamWriter: split halves for concurrent I/O
- NetworkEnvironment: helper for loading environment configs

Uses SURBs for anonymous replies when operating in listener mode.
Adds methods to query exit-capable gateways from the nym-api:
- get_all_basic_exit_assigned_nodes_with_metadata: paginated fetch
- get_basic_exit_assigned_nodes_v2: single page query

Used by IpMixStream for automatic gateway selection.
IpMixStream wraps MixStream to tunnel IP packets through Exit Gateway
IPRs (IP Packet Routers), enabling use of the mixnet as a proxy for
regular internet traffic.

The ip_packet_client module contains IPR connection and protocol logic
forked from nym-ip-packet-client and adapted for SDK use:
- IprClientConnect: handles IPR connection establishment
- IprListener: processes incoming IP packet responses
- Helper functions for IP packet construction/parsing (ICMP, etc.)
- Error types for IPR operations
Updates lib.rs doc comments and README.md to describe new modules:
- stream_wrapper: socket-like abstraction (MixStream, IpMixStream)
- Marks tcp_proxy as deprecated in favor of stream_wrapper
@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nym-explorer-v2 Ready Ready Preview, Comment Jan 12, 2026 6:18pm

@mfahampshire mfahampshire marked this pull request as draft January 12, 2026 18:18
@mfahampshire mfahampshire mentioned this pull request Jan 12, 2026
1 task
@mfahampshire
Copy link
Contributor Author

Not sure why the test monitor::geodata::api_regression::should_parse_response test is failing on the runner, its working locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants