Remove documentation changes (split to separate branch)
This commit is contained in:
@@ -3,7 +3,7 @@ title: "Nym TcpProxy: Route TCP via the Mixnet"
|
||||
description: "Route TCP traffic through the Nym mixnet using the TcpProxy Rust module. Covers architecture, single and multi-connection patterns, and troubleshooting."
|
||||
schemaType: "TechArticle"
|
||||
section: "Developers"
|
||||
lastUpdated: "2026-04-17"
|
||||
lastUpdated: "2026-03-27"
|
||||
---
|
||||
|
||||
# TcpProxy Module
|
||||
@@ -11,7 +11,7 @@ import { Callout } from 'nextra/components';
|
||||
import { CodeVerified } from '../../../components/code-verified'
|
||||
|
||||
<Callout type="error">
|
||||
**This module is unmaintained.** The TcpProxy is no longer actively developed in favour of the [Stream module](/developers/rust/stream), which provides `AsyncRead + AsyncWrite` streams directly over the Mixnet without the TCP socket overhead. Existing users should plan to migrate to streams when possible. The TcpProxy will continue to work but will not receive new features or bug fixes.
|
||||
**This module is unmaintained.** The TcpProxy is no longer actively developed in favour of the [Stream module](./stream), which provides `AsyncRead + AsyncWrite` streams directly over the Mixnet without the TCP socket overhead. Existing users should plan to migrate to streams when possible. The TcpProxy will continue to work but will not receive new features or bug fixes.
|
||||
</Callout>
|
||||
|
||||
The Stream module offers the same key benefit (familiar I/O patterns on top of the Mixnet) with a simpler API. Streams multiplex connections on a single client, eliminate the localhost socket overhead, and now include sequence-based message reordering. There is no remaining reason to choose TcpProxy over Streams for new projects.
|
||||
@@ -20,7 +20,7 @@ The Stream module offers the same key benefit (familiar I/O patterns on top of t
|
||||
|
||||
`NymProxyClient` and `NymProxyServer` proxy TCP traffic through the Mixnet. Both run in a background thread and expose a configurable `localhost` socket that you read and write to like any other TCP connection.
|
||||
|
||||
> Non-Rust/Go developers who want to experiment with this module can start with the [standalone binaries](/developers/tools/standalone-tcpproxy).
|
||||
> Non-Rust/Go developers who want to experiment with this module can start with the [standalone binaries](../tools/standalone-tcpproxy).
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -54,10 +54,11 @@ Add dependencies to `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
nym-sdk = "1.20.4"
|
||||
nym-network-defaults = "1.20.4"
|
||||
nym-bin-common = { version = "1.20.4", features = ["basic_tracing"] }
|
||||
nym-sdk = { git = "https://github.com/nymtech/nym", rev = "97068b2" }
|
||||
nym-network-defaults = { git = "https://github.com/nymtech/nym", rev = "97068b2" }
|
||||
nym-bin-common = { git = "https://github.com/nymtech/nym", rev = "97068b2", features = ["basic_tracing"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
anyhow = "1"
|
||||
blake3 = "=1.7.0" # required pin — see https://nymtech.net/docs/developers/rust/importing
|
||||
|
||||
[[bin]]
|
||||
@@ -77,7 +78,7 @@ The server connects to the Mixnet and forwards incoming traffic to a local TCP s
|
||||
use nym_sdk::tcp_proxy::NymProxyServer;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
nym_bin_common::logging::setup_tracing_logger();
|
||||
|
||||
let mut server = NymProxyServer::new(
|
||||
@@ -105,7 +106,7 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
use tokio::net::TcpStream;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
nym_bin_common::logging::setup_tracing_logger();
|
||||
// Load mainnet network defaults into env vars (required by NymProxyClient's internal ClientPool)
|
||||
setup_env(None::<String>);
|
||||
@@ -168,7 +169,7 @@ The response will take 30–60 seconds to arrive as it traverses the Mixnet in b
|
||||
## Architecture
|
||||
|
||||
Each sub-module handles Nym clients differently:
|
||||
- **`NymProxyClient`** relies on the [Client Pool](/developers/rust/client-pool) to create clients and keep a reserve. If incoming TCP connections outpace the pool, it creates an ephemeral client per connection. One client maps to one TCP connection.
|
||||
- **`NymProxyClient`** relies on the [Client Pool](./client-pool) to create clients and keep a reserve. If incoming TCP connections outpace the pool, it creates an ephemeral client per connection. One client maps to one TCP connection.
|
||||
- **`NymProxyServer`** has a single Nym client with a persistent identity.
|
||||
|
||||
### Sessions & message ordering
|
||||
|
||||
Reference in New Issue
Block a user