| Crates.io | gsc-fq |
| lib.rs | gsc-fq |
| version | 0.9.2 |
| created_at | 2025-11-06 04:22:50.067424+00 |
| updated_at | 2026-01-12 14:52:56.858764+00 |
| description | High-performance TCP proxy with enterprise-grade encryption, TOKEN authentication, CPU hardware acceleration, and reverse proxy capabilities |
| homepage | https://github.com/putao520/gsc-fq |
| repository | https://github.com/putao520/gsc-fq |
| max_upload_size | |
| id | 1919054 |
| size | 4,564,348 |
Features โข Quick Start โข Performance โข Configuration โข Installation
GSC-FQ is a high-performance proxy and stealth tunnel tool written in Rust, supporting forward proxy, reverse proxy, TCP/UDP traffic forwarding, and dual authentication based on Token and TOTP.
| Feature | Description | Use Cases |
|---|---|---|
| Forward Proxy | Forward local port to remote service | Jump Box, internal network penetration |
| Reverse Proxy | Expose internal services via stealth tunnel | Remote work, service exposure |
| UDP Forwarding | Stable UDP traffic forwarding | Gaming, DNS, video streaming |
Note: All configured services start automatically based on your config file. No need to specify modes.
๐ Platform-Specific Optimizations:
๐พ Memory Optimization: Streaming processing, 1.63MB memory for 10MB transfer (-84%)
๐๏ธ Adaptive Transfer: Automatically select optimal strategy based on data size
cargo install gsc-fq
curl -sSLf https://raw.githubusercontent.com/putao520/gsc-fq/main/install.sh | sh
docker pull ghcr.io/putao520/gsc-fq:v0.9.2
docker run -v $(pwd)/config.toml:/app/config.toml ghcr.io/putao520/gsc-fq:v0.9.2
Download pre-built binaries from GitHub Releases:
Linux (x86_64):
wget https://github.com/putao520/gsc-fq/releases/download/v0.9.2/gsc-fq-linux-x86_64.tar.gz
tar xzf gsc-fq-linux-x86_64.tar.gz
sudo mv gsc-fq /usr/local/bin/
Linux (aarch64):
wget https://github.com/putao520/gsc-fq/releases/download/v0.9.2/gsc-fq-linux-aarch64.tar.gz
tar xzf gsc-fq-linux-aarch64.tar.gz
sudo mv gsc-fq /usr/local/bin/
macOS (Intel):
wget https://github.com/putao520/gsc-fq/releases/download/v0.9.2/gsc-fq-macos-x86_64.tar.gz
tar xzf gsc-fq-macos-x86_64.tar.gz
sudo mv gsc-fq /usr/local/bin/
macOS (Apple Silicon):
wget https://github.com/putao520/gsc-fq/releases/download/v0.9.2/gsc-fq-macos-aarch64.tar.gz
tar xzf gsc-fq-macos-aarch64.tar.gz
sudo mv gsc-fq /usr/local/bin/
Windows (x86_64):
# Download from: https://github.com/putao520/gsc-fq/releases/download/v0.9.2/gsc-fq-windows-x86_64.zip
# Extract and add to PATH
Scenario: Forward local port 8080 to remote API server
Configuration (config.toml):
[[proxies]]
local = "8080"
remote = "api.example.com:443"
Run:
gsc-fq
# Or specify config file
gsc-fq -c /path/to/config.toml
Test:
curl http://127.0.0.1:8080/api
Scenario: Run forward proxy and reverse proxy server simultaneously
Configuration (config.toml):
# Forward proxy rules
[[proxies]]
local = "8080"
remote = "api.example.com:443"
[[proxies]]
local = "3000"
remote = "db.example.com:5432"
# Reverse proxy server
[reverse_proxy_server]
port = 9001
allowed_tokens = ["my-secret-token"]
Run:
gsc-fq -c config.toml
What happens:
Scenario: Expose internal service to public internet via stealth tunnel
Server (Public machine config-server.toml):
[reverse_proxy_server]
port = 9001 # Control connection port
allowed_tokens = ["my-secret-token"]
# Optional: Enable TOTP dynamic verification
totp_secret = "JBSWY3DPEHPK3PXP" # Generate with `gsc-fq -g`
Client (Internal machine config-client.toml):
[reverse_proxy_client]
server = "PUBLIC_IP:9001"
token = "my-secret-token"
[[reverse_proxies]]
server_port = "443" # Port exposed on public machine
local = "127.0.0.1:3000" # Local service to expose
Run:
# Public machine
gsc-fq -c config-server.toml
# Internal machine
gsc-fq -c config-client.toml
Access: Visit PUBLIC_IP:443 to access the internal service
Step 1: Generate TOTP secret
$ gsc-fq -g
โ
TOTP secret generated successfully!
๐ฑ Secret: JBSWY3DPEHPK3PXP
๐ Base32: JBSWY3DPEHPK3PXP
๐ท Scan QR code with Google Authenticator:
โโโโโโโโโโโโโโโโโโโโโโโโ
โโ Scan this QR code to add โโ
โโโโโโโโโโโโโโโโโโโโโโโโ
โฐ Verification code updates every 30 seconds
Step 2: Configure server to enable TOTP
[reverse_proxy_server]
port = 9001
totp_secret = "JBSWY3DPEHPK3PXP" # Enter generated secret
Step 3: Client connects with TOTP verification code
# 6-digit code from Google Authenticator
gsc-fq -c config-client.toml
| Platform | Optimization Strategy | 1MB Throughput | 10MB Throughput | Memory Usage |
|---|---|---|---|---|
| macOS | 256KB bulk_copy | 9.15 GB/s (4.02x) | 8.30 GB/s (2.89x) | 1.63 MB |
| Linux | splice() zero-copy | - | +30% (real network) | 1.63 MB |
| Windows | 256KB bulk_copy | 2.28 GB/s | 8.30 GB/s | 1.63 MB |
Benchmark environment: Apple M2, 16GB RAM, localhost loopback
| Metric | GSC-FQ v0.9.2 | Nginx (stream) | HAProxy | socat |
|---|---|---|---|---|
| Throughput (macOS) | 9.15 GB/s | 2.1 GB/s | 1.8 GB/s | 1.2 GB/s |
| Memory Usage (10MB) | 1.63 MB | 5.2 MB | 4.8 MB | 10 MB+ |
| Concurrent Connections | 10,000+ | 10,000+ | 10,000+ | 1,000 |
| Platform Optimization | โ Adaptive | โ Generic | โ Generic | โ Generic |
| Zero-Copy | โ Linux | โ epoll | โ | โ |
๐ High concurrency stress test (200 concurrent connections)
Successful connections: 200 / 200
Failed connections: 0
Total time: 156.23ms
Average latency: 781ฮผs
Throughput: 1280.32 connections/sec
| Argument | Description | Default |
|---|---|---|
-c <PATH> |
Specify config file | config.toml |
-g |
Generate TOTP secret and QR code | - |
-V / --version |
Show version | - |
-h / --help |
Show help information | - |
# ==================== Forward Proxy ====================
# All configured services start automatically - no mode selection needed
[[proxies]]
local = "8080"
remote = "api.example.com:443"
[[proxies]]
local = "3000"
remote = "db.example.com:5432"
# ==================== Reverse Proxy Server ====================
[reverse_proxy_server]
port = 9001
allowed_tokens = ["token1", "token2"]
# TOTP configuration (optional)
totp_secret = "JBSWY3DPEHPK3PXP"
# Connection pool configuration
[connection_pool]
min_idle = 5
max_size = 100
idle_timeout = 300
# ==================== Reverse Proxy Client ====================
[reverse_proxy_client]
server = "PUBLIC_IP:9001"
token = "token1"
# Expose multiple local services
[[reverse_proxies]]
server_port = "443" # HTTPS
local = "127.0.0.1:443"
[[reverse_proxies]]
server_port = "80" # HTTP
local = "127.0.0.1:8080"
[[reverse_proxies]]
server_port = "22" # SSH
local = "127.0.0.1:22"
# ==================== UDP Forwarding ====================
[[udp_proxies]]
local = "127.0.0.1:53"
remote = "8.8.8.8:53"
# ==================== Logging Configuration ====================
[logging]
level = "info" # debug, info, warn, error
file = "/var/log/gsc-fq.log"
max_size = "100MB"
max_backups = 7
Important: All services in the config file will start automatically. You can mix and match any combination:
[[proxies]] - Forward proxy rules[reverse_proxy_server] - Reverse proxy server[reverse_proxy_client] - Reverse proxy client[[udp_proxies]] - UDP forwardingProblem: Local development needs access to remote API with network restrictions
Solution:
# Configure forward proxy
[[proxies]]
local = "8080"
remote = "api.internal.com:443"
# Access
curl http://127.0.0.1:8080/api/users
Problem: Home computer needs access to company internal services
Solution:
# Company server (public IP)
[reverse_proxy_server]
port = 9001
totp_secret = "xxx"
# Home computer
[reverse_proxy_client]
server = "COMPANY_PUBLIC_IP:9001"
[[reverse_proxies]]
server_port = "8080"
local = "127.0.0.1:80" # Company internal OA system
Problem: UDP game packets unstable
Solution:
[[udp_proxies]]
local = "127.0.0.1:25565"
remote = "game-server.com:25565"
| Category | Coverage | Test Count |
|---|---|---|
| Normal Scenarios | 100% | 8 tests |
| Error Scenarios | 85% | 6 tests |
| High Concurrency | 90% | 3 tests |
| Edge Cases | 95% | 4 tests |
| Data Validation | 95% | 4 tests |
| Overall | 91% | 25 tests |
# Run all tests
cargo test
# Run E2E tests
cargo test --test network_resilience_test
cargo test --test high_concurrency_stress_test
cargo test --test edge_cases_test
cargo test --test data_forwarding_validation_test
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Platform-Specific Optimization Layer โ
โโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโค
โ macOS โ Linux โ Windows โ Generic โ
โ 256KB โ splice() โ 256KB โ 256KB โ
โ bulk_copyโ zero-copyโ bulk_copyโ bulk_copyโ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Adaptive Transfer Strategy โ
โโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโค
โ Small โ Medium โ Large โ Stream โ
โ < 64KB โ 64KB-1MB โ 1MB-10MB โ > 10MB โ
โ tokio โ 128KB โ 256KB โ splice() โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Connection Management & Multiplexing โ
โ Yamux + Connection Pool + Blackhole โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
adaptive_copy.rs: Known-size data adaptive transferadaptive_stream.rs: Unknown-size streaming transfersplice_optimizer.rs: Linux splice() zero-copy optimizerzero_copy.rs: Platform-specific zero-copy implementationstealth_handler.rs: Stealth tunnel handling (blackhole mode)Contributions are welcome! Please follow these steps:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)cargo fmtcargo clippycargo testSee CHANGELOG.md for detailed update history.
A: Use debug mode or specify log file
# Debug mode
RUST_LOG=debug gsc-fq
# Specify log file
[logging]
level = "debug"
file = "/var/log/gsc-fq.log"
A: Check the following
ping, telnet)A: Optimization suggestions
[connection_pool]
min_idle = 10 # Increase min idle connections
max_size = 200 # Increase connection pool size
idle_timeout = 600 # Extend idle timeout
A: Fully supported!
docker run -d \
-v $(pwd)/config.toml:/app/config.toml \
-p 8080:8080 \
ghcr.io/putao520/gsc-fq:v0.9.2
Dual-licensed under MIT or Apache-2.0.