All Projects → ezekiiel → tcp-proxy

ezekiiel / tcp-proxy

Licence: other
A TCP proxy in 30 lines of Rust

Programming Languages

shell
77523 projects
rust
11053 projects

Projects that are alternatives of or similar to tcp-proxy

ParallelCollectionMonitoring
使用数十个.NET客户端控制硬件设备进行工作,采集数据并进行处理,管理人员通过 Android 应用实时控制各设备的工作。本作品获得第十二届中国研究生电子设计竞赛华南赛区一等奖。
Stars: ✭ 21 (-30%)
Mutual labels:  tcp
Python-Botnet
This is a simple DDoS python botnet script with remote monitoring & management for education purposes.
Stars: ✭ 119 (+296.67%)
Mutual labels:  tcp
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (+243.33%)
Mutual labels:  tcp
monte
The bare minimum for high performance, fully-encrypted bidirectional RPC over TCP in Go with zero memory allocations.
Stars: ✭ 103 (+243.33%)
Mutual labels:  tcp
messenger
TCP 即时通讯 WPF 界面.
Stars: ✭ 18 (-40%)
Mutual labels:  tcp
terabit-network-stack-profiling
Tools for profiling the Linux network stack.
Stars: ✭ 68 (+126.67%)
Mutual labels:  tcp
natcross2
内网穿透工具
Stars: ✭ 111 (+270%)
Mutual labels:  tcp
poc-mp4-websocket
Streaming MP4 over Websocket using BMFF
Stars: ✭ 25 (-16.67%)
Mutual labels:  tcp
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+200%)
Mutual labels:  tcp
fire-im
分布式IM服务,参考https://github.com/crossoverJie/cim 实现
Stars: ✭ 17 (-43.33%)
Mutual labels:  tcp
PsNetTools
PsNetTools is a cross platform PowerShell module to test network features on Windows, Linux and Mac.
Stars: ✭ 13 (-56.67%)
Mutual labels:  tcp
cs
开箱即用的基于命令的消息处理框架,让 websocket 和 tcp 开发就像 http 那样简单
Stars: ✭ 19 (-36.67%)
Mutual labels:  tcp
ddos
Simple dos attack utility
Stars: ✭ 36 (+20%)
Mutual labels:  tcp
databento-python
Official Python client library for Databento
Stars: ✭ 16 (-46.67%)
Mutual labels:  tcp
escper
Ruby gem for printing of images and text on one or many thermal printers
Stars: ✭ 67 (+123.33%)
Mutual labels:  tcp
opengnb
GNB is open source de-centralized VPN to achieve layer3 network via p2p with the ultimate capability of NAT Traversal.GNB是一个开源的去中心化的具有极致内网穿透能力的通过P2P进行三层网络交换的VPN。
Stars: ✭ 440 (+1366.67%)
Mutual labels:  tcp
black-hat-python3-code
🏴‍☠️ tools (py3 version) of Black Hat Python book 🏴‍☠️
Stars: ✭ 51 (+70%)
Mutual labels:  tcp
XTCP
一个便捷的TCP消息包拼装和解析框架
Stars: ✭ 20 (-33.33%)
Mutual labels:  tcp
node-port-mux
TCP port multiplexer: run multiple services through the same port
Stars: ✭ 12 (-60%)
Mutual labels:  tcp
riemannx
A riemann client for elixir (TCP/UDP/TLS supported)
Stars: ✭ 23 (-23.33%)
Mutual labels:  tcp

Proxy

A simple Rust TCP proxy. Intended to be educational - don't use this in production.

Terminoligy

server - the listener we'd like to proxy tcp connections to. client - the initiator of connections to the server.

Benchmarking

Using localhost:

  1. Start the proxy in one terminal window
    cargo run -- -c 0.0.0.0:1212 -s 127.0.0.1:1313
  2. Listen on the origin port in another window
    nc -l 1313 > /dev/null
    
  3. Send a bunch of traffic from another window
    dd if=/dev/zero bs=1024 count=900000 | nc -v 127.0.0.1 1212
    

Using network namespaces:

If you have a debian linux machine you can use ns_test.sh to run a benchmark using three network namespaces.

Local Results

Using the proxy:

~ dd if=/dev/zero bs=1024 count=900000 | nc -v 127.0.0.1 1212
Connection to 127.0.0.1 port 1212 [tcp/lupa] succeeded!
900000+0 records in
900000+0 records out
921600000 bytes transferred in 4.369209 secs (210930626 bytes/sec)

Connecting directly to the server:

~ dd if=/dev/zero bs=1024 count=900000 | nc -v 127.0.0.1 1313
Connection to 127.0.0.1 port 1313 [tcp/bmc_patroldb] succeeded!
900000+0 records in
900000+0 records out
921600000 bytes transferred in 3.612901 secs (255085873 bytes/sec)

Results

(* 100 (/ 210930626.0 255085873.0))
=> 82.69004610851186

The tcp proxy is 82% the speed of a regular connection.

Network Namespace Results

Using the proxy:

921600000 bytes (922 MB, 879 MiB) copied, 25.4762 s, 36.2 MB/s

Connecting directly to the server:

921600000 bytes (922 MB, 879 MiB) copied, 5.17278 s, 178 MB/s

Results:

(* 100 (/ 36.2 178))
=> 20.337078651685395

the tcp proxy is 20% the speed of a regular connection.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].