Full working example: Setup and verify Shadowsocks
masterTo test the server locally, follow these steps in sequence:
- Start the server: Run the server with a sample config and metrics enabled.
- Start Prometheus: Use a Prometheus configuration file to scrape the server metrics.
- Start the client: Use
go-shadowsocks2to create a SOCKS proxy. - Verify connection: Use
curlthrough the SOCKS proxy to fetch a webpage. - Check metrics: Access the Prometheus metrics endpoint via browser or API.
# 1. Run the server
go run ./cmd/outline-ss-server -config cmd/outline-ss-server/config_example.yml -metrics localhost:9091 --replay_history=10000
# 2. Run Prometheus scraper
prometheus --config.file=cmd/outline-ss-server/prometheus_example.yml
# 3. Run SOCKS-to-Shadowsocks client
go run github.com/shadowsocks/go-shadowsocks2@latest -c ss://chacha20-ietf-poly1305:Secret0@:9000 -verbose -socks localhost:1080
# 4. Fetch a page over Shadowsocks
curl --proxy socks5h://localhost:1080 example.com
# 5. Check metrics
curl http://localhost:9091/metrics