{"id":13486762,"url":"https://github.com/shadowsocks/go-shadowsocks2","last_synced_at":"2025-10-06T16:32:42.028Z","repository":{"id":37359347,"uuid":"81075667","full_name":"shadowsocks/go-shadowsocks2","owner":"shadowsocks","description":"Modern Shadowsocks in Go","archived":false,"fork":true,"pushed_at":"2024-10-20T09:23:47.000Z","size":117,"stargazers_count":4555,"open_issues_count":47,"forks_count":1423,"subscribers_count":172,"default_branch":"master","last_synced_at":"2024-12-06T16:24:30.007Z","etag":null,"topics":["golang","shadowsocks"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"riobard/go-shadowsocks2","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shadowsocks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-06T10:28:11.000Z","updated_at":"2024-12-05T06:37:06.000Z","dependencies_parsed_at":"2023-02-14T06:31:34.358Z","dependency_job_id":null,"html_url":"https://github.com/shadowsocks/go-shadowsocks2","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowsocks%2Fgo-shadowsocks2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowsocks%2Fgo-shadowsocks2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowsocks%2Fgo-shadowsocks2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowsocks%2Fgo-shadowsocks2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadowsocks","download_url":"https://codeload.github.com/shadowsocks/go-shadowsocks2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235538025,"owners_count":19006071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","shadowsocks"],"created_at":"2024-07-31T18:00:50.803Z","updated_at":"2025-10-06T16:32:36.699Z","avatar_url":"https://github.com/shadowsocks.png","language":"Go","funding_links":[],"categories":["Go","Shadowsocks \u0026 Variants"],"sub_categories":[],"readme":"# go-shadowsocks2\n\nA fresh implementation of Shadowsocks in Go.\n\nGoDoc at https://godoc.org/github.com/shadowsocks/go-shadowsocks2/\n\n![Build and test](https://github.com/shadowsocks/go-shadowsocks2/workflows/Build%20and%20test/badge.svg)\n\n\n## Features\n\n- [x] SOCKS5 proxy with UDP Associate\n- [x] Support for Netfilter TCP redirect on Linux (IPv6 should work but not tested)\n- [x] Support for Packet Filter TCP redirect on MacOS/Darwin (IPv4 only)\n- [x] UDP tunneling (e.g. relay DNS packets)\n- [x] TCP tunneling (e.g. benchmark with iperf3)\n- [x] SIP003 plugins\n- [x] Replay attack mitigation\n\n\n## Install\n\nPre-built binaries for common platforms are available at https://github.com/shadowsocks/go-shadowsocks2/releases\n\nInstall from source\n\n```sh\ngo install -u github.com/shadowsocks/go-shadowsocks2@latest\n```\n\n\n## Basic Usage\n\n### Server\n\nStart a server listening on port 8488 using `AEAD_CHACHA20_POLY1305` AEAD cipher with password `your-password`.\n\n```sh\ngo-shadowsocks2 -s 'ss://AEAD_CHACHA20_POLY1305:your-password@:8488' -verbose\n```\n\n\n### Client\n\nStart a client connecting to the above server. The client listens on port 1080 for incoming SOCKS5 \nconnections, and tunnels both UDP and TCP on port 8053 and port 8054 to 8.8.8.8:53 and 8.8.4.4:53 \nrespectively. \n\n```sh\ngo-shadowsocks2 -c 'ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488' \\\n    -verbose -socks :1080 -u -udptun :8053=8.8.8.8:53,:8054=8.8.4.4:53 \\\n                             -tcptun :8053=8.8.8.8:53,:8054=8.8.4.4:53\n```\n\nReplace `[server_address]` with the server's public address.\n\n\n## Advanced Usage\n\n\n### Netfilter TCP redirect on Linux\n\nThe client offers `-redir` and `-redir6` (for IPv6) options to handle TCP connections \nredirected by Netfilter on Linux. The feature works similar to `ss-redir` from `shadowsocks-libev`.\n\n\nStart a client listening on port 1082 for redirected TCP connections and port 1083 for redirected\nTCP IPv6 connections.\n\n```sh\ngo-shadowsocks2 -c 'ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488' -redir :1082 -redir6 :1083\n```\n\n\n### TCP tunneling\n\nThe client offers `-tcptun [local_addr]:[local_port]=[remote_addr]:[remote_port]` option to tunnel TCP.\nFor example it can be used to proxy iperf3 for benchmarking.\n\nStart iperf3 on the same machine with the server.\n\n```sh\niperf3 -s\n```\n\nBy default iperf3 listens on port 5201.\n\nStart a client on the same machine with the server. The client listens on port 1090 for incoming connections\nand tunnels to localhost:5201 where iperf3 is listening.\n\n```sh\ngo-shadowsocks2 -c 'ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488' -tcptun :1090=localhost:5201\n```\n\nStart iperf3 client to connect to the tunneld port instead\n\n```sh\niperf3 -c localhost -p 1090\n```\n\n### SIP003 Plugins (Experimental)\n\nBoth client and server support SIP003 plugins.\nUse `-plugin` and `-plugin-opts` parameters to enable.\n\nClient:\n\n```sh\ngo-shadowsocks2 -c 'ss://AEAD_CHACHA20_POLY1305:your-password@[server_address]:8488' \\\n    -verbose -socks :1080 -u -plugin v2ray\n```\nServer:\n\n```sh\ngo-shadowsocks2 -s 'ss://AEAD_CHACHA20_POLY1305:your-password@:8488' -verbose \\\n    -plugin v2ray -plugin-opts \"server\"\n```\nNote:\n\nIt will look for the plugin in the current directory first, then `$PATH`.\n\nUDP connections will not be affected by SIP003.\n\n### Replay Attack Mitigation\n\nBy default a [Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter) is deployed to defend against [replay attacks](https://en.wikipedia.org/wiki/Replay_attack).\nUse the following environment variables to fine-tune the mechanism:\n\n- `SHADOWSOCKS_SF_CAPACITY`: Number of recent connections to track. Default `1e6` (one million). Setting it to 0 disables the feature.\n- `SHADOWSOCKS_SF_FPR`: False positive rate of the Bloom filter. Default `1e-6` (0.0001%). This should be enough for most cases.\n- `SHADOWSOCKS_SF_SLOT`: The Bloom filter is divided into a number (default `10`) of slots. When the Bloom filter is full, the\n  oldest slot will be cleared for recycling. In general you should not change this number unless you understand what you are doing.\n\n```sh\nSHADOWSOCKS_SF_CAPACITY=1e6 SHADOWSOCKS_SF_FPR=1e-6 SHADOWSOCKS_SF_SLOT=10 go-shadowsocks2 ...\n```\n\n## Design Principles\n\nThe code base strives to\n\n- be idiomatic Go and well organized;\n- use fewer external dependences as reasonably possible;\n- only include proven modern ciphers;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowsocks%2Fgo-shadowsocks2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowsocks%2Fgo-shadowsocks2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowsocks%2Fgo-shadowsocks2/lists"}