Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UDPlex 是一个功能丰富的 UDP 转发和隧道工具,旨在提供高性能和可扩展性。

License

Notifications You must be signed in to change notification settings

tao08141/UDPlex

Repository files navigation

UDPlex

English | 中文

UDPlex is an efficient UDP packet bidirectional forwarding tool that supports forwarding UDP traffic to multiple target servers simultaneously, handling return traffic, and supporting authentication, encryption, and other features. It is suitable for gaming acceleration, network redundancy, and traffic distribution scenarios.

Features

  • Listen on specified UDP ports to receive packets
  • Forward packets in parallel to multiple target servers
  • Support bidirectional traffic forwarding
  • Automatic reconnection for broken connections
  • Configurable buffer sizes and timeout parameters
  • Support authentication and encrypted transmission
  • Support protocol detection and filtering
  • Support Docker deployment

Usage

  1. Edit the config.yaml file to configure listening addresses and forwarding targets
  2. Run the program:
# Use default configuration file
./UDPlex

# Or specify configuration file path
./UDPlex -c /path/to/config.yaml

Docker Usage

Using Docker Commands

# Pull the image
docker pull ghcr.io/tao08141/udplex:latest

# Run container (using host network mode)
docker run -d --name udplex --network host \
  -v $(pwd)/config.yaml:/app/config.yaml \
  ghcr.io/tao08141/udplex:latest

# Using port mapping mode (if not using host network mode)
docker run -d --name udplex \
  -v $(pwd)/config.yaml:/app/config.yaml \
  -p 9000:9000/udp \
  ghcr.io/tao08141/udplex:latest

Using Docker Compose

  1. Download the docker-compose.yml file:
mkdir udplex && cd udplex
# Download docker-compose.yml file
curl -o docker-compose.yml https://raw.githubusercontent.com/tao08141/UDPlex/refs/heads/master/docker-compose.yml
# Download configuration file
curl -o config.yaml https://raw.githubusercontent.com/tao08141/UDPlex/refs/heads/master/examples/basic.yaml
  1. Start the service:
docker-compose up -d
  1. View logs:
docker-compose logs -f
  1. Stop the service:
docker-compose down

Note: For UDP forwarding applications, it is recommended to use host network mode (network_mode: host) for optimal performance.

WireGuard One-click Deployment Tutorial

UDPlex Parameter Details

Global Configuration

Parameter Description
buffer_size UDP packet buffer size (bytes), recommended to set to MTU size, usually 1500
queue_size Inter-component packet queue size, increase for high traffic scenarios
worker_count Number of worker threads, affects concurrent processing capability
services Component configuration array, defines all processing components in the system
protocol_detectors Protocol detector configuration for identifying and filtering packets of specific protocols

Service Component Parameters

UDPlex supports multiple component types, each with specific functions and configuration parameters. For detailed documentation, please refer to:

Authentication Configuration

UDPlex supports packet authentication and encryption features. For detailed documentation, please refer to:

Protocol Detectors

UDPlex supports configuring protocol detectors to identify and classify specific protocols in UDP packets. For detailed documentation, please refer to:

RESTful API Interface

UDPlex provides RESTful API interfaces to query component status and connection information.

  • RESTful - RESTful interface configuration and usage instructions

Use Cases

  • Game Acceleration: Simultaneously forwards game traffic through multiple paths, greatly reducing packet loss.
  • Bandwidth Aggregation: Aggregates the bandwidth of multiple network connections to improve overall network speed.
  • Protocol-based Classification: Uses protocol detectors to distribute different protocol traffic to different processing paths, such as prioritizing important heartbeat packets.
  • UDP over TCP Tunnel: Transmits UDP traffic in network environments that do not support UDP.
  • Network Debugging: Forwards UDP traffic to a specified server for debugging and analysis without affecting the original network structure.
  • Load Balancing: Intelligently distributes packets based on traffic volume and load balancing strategies, supporting various algorithms. For example, when traffic is low, packets are forwarded to both servers to avoid packet loss; when traffic exceeds a certain threshold, packets are distributed in a round-robin manner to ensure bandwidth.

Configuration Examples

The examples directory contains configuration examples for various use cases:

About

UDPlex 是一个功能丰富的 UDP 转发和隧道工具,旨在提供高性能和可扩展性。

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •