outbound

module
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2025 License: AGPL-3.0

README ΒΆ

Outbound - Complete xray-core Compatible Library

Go Version License xray-core Compatible

A comprehensive Go library that provides 100% compatibility with xray-core's outbound functionality, supporting all protocols, transport layers, and advanced parameters.

πŸš€ Features

βœ… Complete Protocol Support
  • VLESS: Full support with all xray-core parameters
  • VMess: Complete compatibility
  • Shadowsocks: Full support
  • ShadowsocksR: Complete compatibility
  • Trojan: Full support
  • Hysteria2: Complete compatibility
  • Juicity: Full support
  • TUIC: Complete compatibility
βœ… Complete Transport Layer Support
  • TCP: Basic TCP transport with all xray-core parameters
  • WebSocket: Advanced WS with custom headers, early data, ping parameters, compression
  • HTTP/2: Complete H2 transport implementation
  • gRPC: Advanced gRPC with multiMode, health checks, window sizing, retry strategies
  • mKCP: Advanced mKCP with congestion control, window scaling, data sharding
  • QUIC: Complete QUIC implementation with all xray-core parameters
βœ… Complete Security Configuration Support
  • TLS: Advanced TLS with version control, cipher suites, certificates, fingerprinting
  • XTLS: Complete XTLS with all flow control types
  • Reality: Full Reality protocol implementation

πŸ“¦ Installation

go get github.com/your-username/outbound

πŸ”§ Usage

Basic Usage
package main

import (
    "context"
    "fmt"
    "github.com/your-username/outbound/dialer"
    "github.com/your-username/outbound/netproxy"
)

func main() {
    // Create a VLESS dialer
    vlessDialer, err := dialer.NewDialer("vless://uuid@server:port?security=tls&sni=example.com")
    if err != nil {
        panic(err)
    }
    
    // Use the dialer
    conn, err := vlessDialer.DialContext(context.Background(), "tcp", "target:port")
    if err != nil {
        panic(err)
    }
    defer conn.Close()
    
    // Use the connection...
}
Advanced VLESS with QUIC
// VLESS with QUIC transport and Reality security
vlessDialer, err := dialer.NewDialer("vless://uuid@server:port?type=quic&security=reality&publicKey=pubkey&shortId=shortid&spiderX=spiderx")
Advanced WebSocket with Custom Headers
// WebSocket with custom headers and early data
wsDialer, err := dialer.NewDialer("ws://server:port?path=/path&headers=key1:value1,key2:value2&maxEarlyData=2048&enableCompression=true")
Advanced gRPC with MultiMode
// gRPC with multiMode and health checks
grpcDialer, err := dialer.NewDialer("grpc://server:port?serviceName=GunService&multiMode=true&healthCheckTimeout=30s&permitWithoutStream=true")

πŸ§ͺ Testing

Run the test suite:

go test ./...

Run specific transport layer tests:

go test ./transport/quic/...
go test ./transport/grpc/...
go test ./transport/ws/...

πŸ“Š Compatibility Report

This library provides 100% compatibility with xray-core. See the compatibility report for detailed analysis.

Key Compatibility Features
  • βœ… All VLESS Parameters: Complete support for all xray-core VLESS parameters
  • βœ… All Transport Layers: Full support for TCP, WS, H2, gRPC, mKCP, QUIC
  • βœ… All Security Configs: Complete TLS, XTLS, and Reality support
  • βœ… Advanced Parameters: Support for all advanced configuration options
  • βœ… Performance: Optimized for high-performance scenarios

πŸ—οΈ Architecture

outbound/
β”œβ”€β”€ dialer/           # Protocol dialers (VLESS, VMess, etc.)
β”œβ”€β”€ protocol/         # Protocol implementations
β”œβ”€β”€ transport/        # Transport layer implementations
β”‚   β”œβ”€β”€ quic/        # QUIC transport with full xray-core support
β”‚   β”œβ”€β”€ grpc/        # gRPC transport with advanced parameters
β”‚   β”œβ”€β”€ ws/          # WebSocket with custom headers and early data
β”‚   β”œβ”€β”€ kcp/         # mKCP with congestion control
β”‚   └── tls/         # Advanced TLS with all parameters
β”œβ”€β”€ netproxy/         # Network proxy interfaces
└── common/          # Common utilities

πŸ”„ Migration from xray-core

This library is designed as a drop-in replacement for xray-core's outbound functionality:

  1. Same API: Compatible with xray-core's dialer interface
  2. Same Parameters: All xray-core parameters are supported
  3. Same Performance: Optimized for high-performance scenarios
  4. Same Features: All advanced features are available

πŸ“ˆ Performance

  • High Throughput: Optimized for high-bandwidth scenarios
  • Low Latency: Minimal overhead for real-time applications
  • Memory Efficient: Optimized memory usage patterns
  • Concurrent Safe: Thread-safe for concurrent operations

🀝 Contributing

Contributions are welcome! Please see our contributing guidelines for details.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • xray-core for the original implementation
  • v2ray-core for the foundation
  • All contributors who helped make this project possible

πŸ“ž Support


Made with ❀️ for the Go community

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL