connect

command
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: CC0-1.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

SOCKS Proxy CONNECT Client Example

A simple CLI client example demonstrating how to use socksgo to make HTTP requests through a SOCKS proxy.

Usage

go run . [options]
Options
  • -proxy: SOCKS proxy URL (default: socks5://127.0.0.1:1080)
  • -url: Target URL to fetch (default: http://example.com)

Examples

Basic SOCKS5 Proxy
# Connect through local SOCKS5 proxy
go run . -proxy socks5://localhost:1080 -url http://example.com

# With authentication
go run . -proxy socks5://user:pass@localhost:1080 -url http://httpbin.org/ip
SOCKS4 Proxy
go run . -proxy socks4://localhost:1080 -url http://example.com
SOCKS5 over TLS

First start the TLS server from ../server:

# Terminal 1: Start TLS SOCKS server
cd ../server
go run . -tls-addr :1081

# Terminal 2: Connect via TLS
cd ../client
go run . -proxy socks5+tls://localhost:1081 -url http://example.com
SOCKS5 over WebSocket
# Terminal 1: Start WebSocket SOCKS server
cd ../server
go run . -ws-addr :1082

# Terminal 2: Connect via WebSocket
cd ../client
go run . -proxy socks5+ws://localhost:1082/ws -url http://example.com
Tor Proxy
# Connect through Tor SOCKS proxy (default port 9050)
go run . -proxy socks5://localhost:9050 -url http://check.torproject.org

Documentation

Overview

nolint

Jump to

Keyboard shortcuts

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