server

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: 23 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 Server Example

A comprehensive SOCKS5 proxy server example demonstrating TCP, TLS, and WebSocket transports with logging.

Run with defaults:

go run .

This starts:

  • TCP listener on 127.0.0.1:1080
  • TLS listener on 127.0.0.1:1081 (self signed certificates)
  • WebSocket listener on 127.0.0.1:1082 at /ws

Options

  • -tcp-addr: TCP listen address (default: 127.0.0.1:1080)
  • -tls-addr: TLS listen address (default: 127.0.0.1:1081)
  • -ws-addr: WebSocket listen address (default: 127.0.0.1:1082)
  • -ws-origin: allowed WebSocket Origin patterns, comma-separated. Empty uses the coder/websocket default, which permits same-host browser requests.
  • -user, -pass: enable username/password auth when both are set.

Curl

# No auth
curl -4 --proxy socks5://localhost:1080 http://example.com

# Pass auth
curl -4 --proxy socks5://myuser:mypass@localhost:1080 http://example.com

Gost

# Run chain socks -> socks+tls
gost -L socks5://:1090 -F socks5+tls://localhost:1081

# Run chain socks -> socks+ws
gost -L socks5://:1090 -F socks5+ws://localhost:1082

Then use curl as usual

curl -4 --proxy socks5://localhost:1090 http://example.com

Documentation

Overview

nolint

Jump to

Keyboard shortcuts

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