8000 GitHub - cnlangzi/proxyclient: Enhanced HTTP Client with Multi-Proxy Support(http/socks/ssh/vmess/vless/ss/ssr/trojan/mtproto) for Go
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enhanced HTTP Client with Multi-Proxy Support(http/socks/ssh/vmess/vless/ss/ssr/trojan/mtproto) for Go

License

Notifications You must be signed in to change notification settings

cnlangzi/proxyclient

Repository files navigation

ProxyClient

Enhanced HTTP Client with Multi-Proxy Support for Go

ProxyClient is a Go package that extends the standard http.Client to seamlessly support multiple proxy protocols, including HTTP/HTTPS, SOCKS4, SOCKS5, SSL, V2Ray, SSR/SS, and MTProto. It provides a unified interface for developers to interact with diverse proxy types without manual low-level configurations.

Tests Codecov Go Report Card Go Reference GitHub Release License PRs welcome

Features

Multi-Protocol Support:
HTTP/HTTPS Proxy: Direct and authenticated connections.
SOCKS4/SOCKS5: Full support for SOCKS protocols (IPv4/IPv6).
SSL/TLS Tunneling: Secure proxy tunneling for encrypted traffic.
V2Ray/SSR/SS: Integration with popular proxy tools (Shadowsocks, V2Ray core).
MTProto: Native support for Telegram’s MTProto protocol.

Simplified API: Create a proxy-enabled client with a single function call.
Authentication: Built-in handling for username/password, encryption keys, and token-based auth.
Compatibility: Fully compatible with Go’s standard http.Client methods (Get, Post, etc.).

Quick Start

Installation

go get github.com/cnlangzi/proxyclient

Usage Example

package main

import (
    "fmt"
    "github.com/cnlangzi/proxyclient"
    // import v5 vmess/vless
    _ "github.com/cnlangzi/proxyclient/v2ray"
)

func main() {
    // Create a client with SOCKS5 proxy
    client, err := proxyclient.New("socks5://user:pass@127.0.0.1:1080")
    
    if err != nil {
        panic(err)
    }

    // Use like a standard http.Client
    resp, err := client.Get("https://example.com")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Println("Response status:", resp.Status)
}

Supported Proxy Types

Protocol Example Config
http http://user:pass@127.0.0.1:8080
https https://user:pass@127.0.0.1:8080
socks4 socks4://user:pass@127.0.0.1:1080
socks5 socks5://user:pass@127.0.0.1:1080
trojan trojan://pass@host:40021?allowInsecure=0&sni=&type=ws
vmess(v5) vmess://eyJ2IjogIjIiLCAicHMiOiAiXHU1Yz...
vless(v5) vless://uuid@host:port?allowInsecure=false&security=tls...
ss ss://user:pass@127.0.0.1:8080
ssr ssr://user:pass@127.0.0.1:8080
ssh ssh://user:pass@127.0.0.1:2222
MTProto mtproto://user:pass@127.0.0.1:8080

Why Use proxyclient?

Unified Interface: Simplify code for multi-proxy environments.
Extensible: Easily add new proxy protocols via modular design.


Contributions welcome! 🚀

0