{"id":56907,"date":"2025-03-01T11:22:02","date_gmt":"2025-03-01T03:22:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/56907\/"},"modified":"2025-03-01T11:22:02","modified_gmt":"2025-03-01T03:22:02","slug":"golang-shadowsocks-%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/56907\/","title":{"rendered":"Golang Shadowsocks \u5b8c\u5168\u6307\u5357"},"content":{"rendered":"<p>\u5728\u73b0\u4ee3\u7f51\u7edc\u73af\u5883\u4e2d\uff0c<em>Golang Shadowsocks<\/em> \u6210\u4e3a\u4e86\u4e00\u79cd\u6d41\u884c\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3001\u4fdd\u62a4\u7f51\u7edc\u9690\u79c1\u7b49\u573a\u666f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Golang \u5b9e\u73b0 Shadowsocks\uff0c\u5305\u62ec\u5b89\u88c5\u6b65\u9aa4\u3001\u914d\u7f6e\u65b9\u6cd5\u548c\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\u3002<\/p>\n<h2>\u4ec0\u4e48\u662f Shadowsocks?<\/h2>\n<p><em>Shadowsocks<\/em> \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u7f51\u7edc\u4ee3\u7406\u5de5\u5177\uff0c\u5e38\u7528\u4e8e\u7a81\u7834\u7f51\u7edc\u9650\u5236\u548c\u4fdd\u62a4\u7528\u6237\u7684\u9690\u79c1\u3002\u5176\u539f\u7406\u662f\u901a\u8fc7\u52a0\u5bc6\u6280\u672f\uff0c\u5c06\u7528\u6237\u7684\u7f51\u7edc\u6d41\u91cf\u7ecf\u8fc7\u4ee3\u7406\u670d\u52a1\u5668\u8fdb\u884c\u8f6c\u53d1\u3002Golang \u4f5c\u4e3a\u4e00\u79cd\u9ad8\u6548\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u5b9e\u73b0 Shadowsocks \u7684\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u3002<\/p>\n<h2>Golang Shadowsocks \u7684\u4f18\u52bf<\/h2>\n<ul>\n<li><strong>\u9ad8\u6027\u80fd<\/strong>: Golang \u7684\u5e76\u53d1\u5904\u7406\u80fd\u529b\u975e\u5e38\u5f3a\uff0c\u80fd\u591f\u5904\u7406\u5927\u91cf\u7684\u8fde\u63a5\u8bf7\u6c42\u3002<\/li>\n<li><strong>\u8de8\u5e73\u53f0<\/strong>: Golang \u7f16\u5199\u7684 Shadowsocks \u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5982 Linux\u3001Windows \u548c macOS\u3002<\/li>\n<li><strong>\u5f00\u6e90\u793e\u533a<\/strong>: \u6709\u5927\u91cf\u7684\u5f00\u6e90\u8d44\u6e90\u548c\u793e\u533a\u652f\u6301\uff0c\u6613\u4e8e\u5b66\u4e60\u548c\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h2>\u5982\u4f55\u5b89\u88c5 Golang Shadowsocks<\/h2>\n<h3>\u7cfb\u7edf\u9700\u6c42<\/h3>\n<p>\u5728\u5b89\u88c5 Golang Shadowsocks \u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86 Golang \u548c Git\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5b89\u88c5:<\/p>\n<p>bash go version git \u2013version<\/p>\n<h3>\u5b89\u88c5\u6b65\u9aa4<\/h3>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u4ee3\u7801<\/strong>: \u4f7f\u7528 Git \u514b\u9686 Shadowsocks \u7684 Golang \u5b9e\u73b0\u4ee3\u7801\u5e93\u3002<\/p>\n<p>bash git clone https:\/\/github.com\/shadowsocks\/shadowsocks-go.git<\/p>\n<\/li>\n<li>\n<p><strong>\u8fdb\u5165\u76ee\u5f55<\/strong>: \u5207\u6362\u5230\u4e0b\u8f7d\u7684\u76ee\u5f55\u3002<\/p>\n<p>bash cd shadowsocks-go<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>: \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u3002<\/p>\n<p>bash go get -v .\/\u2026<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u8bd1\u4ee3\u7801<\/strong>: \u4f7f\u7528 Golang \u7f16\u8bd1 Shadowsocks\u3002<\/p>\n<p>bash go build -o ssserver .\/cmd\/ssserver\/main.go<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8\u670d\u52a1<\/strong>: \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8 Shadowsocks \u670d\u52a1\u3002<\/p>\n<p>bash .\/ssserver -s :1080 -m aes-256-gcm -k your_password<\/p>\n<\/li>\n<\/ol>\n<h3>\u914d\u7f6e\u53c2\u6570<\/h3>\n<p>\u5728\u542f\u52a8\u670d\u52a1\u65f6\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u8c03\u6574\u4ee5\u4e0b\u53c2\u6570\uff1a<\/p>\n<ul>\n<li><code>-s<\/code> : \u7ed1\u5b9a\u5730\u5740\u4e0e\u7aef\u53e3\u3002<\/li>\n<li><code>-m<\/code> : \u52a0\u5bc6\u65b9\u5f0f\uff0c\u5982 aes-256-gcm\u3002<\/li>\n<li><code>-k<\/code> : \u5bc6\u7801\u3002<\/li>\n<\/ul>\n<h2>\u5982\u4f55\u4f7f\u7528 Golang Shadowsocks \u5ba2\u6237\u7aef<\/h2>\n<h3>\u5b89\u88c5\u5ba2\u6237\u7aef<\/h3>\n<ol>\n<li>\n<p><strong>\u4e0b\u8f7d\u5ba2\u6237\u7aef<\/strong>: \u548c\u670d\u52a1\u7aef\u76f8\u540c\uff0c\u514b\u9686\u5ba2\u6237\u7aef\u4ee3\u7801\u5e93\u3002<\/p>\n<p>bash git clone https:\/\/github.com\/shadowsocks\/shadowsocks-go.git<\/p>\n<\/li>\n<li>\n<p><strong>\u8fdb\u5165\u76ee\u5f55<\/strong>: \u5207\u6362\u5230\u4e0b\u8f7d\u7684\u76ee\u5f55\u3002<\/p>\n<p>bash cd shadowsocks-go<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u8bd1\u5ba2\u6237\u7aef<\/strong>: \u4f7f\u7528 Golang \u7f16\u8bd1 Shadowsocks \u5ba2\u6237\u7aef\u3002<\/p>\n<p>bash go build -o sslocal .\/cmd\/sslocal\/main.go<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8\u5ba2\u6237\u7aef<\/strong>: \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8 Shadowsocks \u5ba2\u6237\u7aef\u3002<\/p>\n<p>bash .\/sslocal -s your_server_ip:1080 -k your_password -m aes-256-gcm<\/p>\n<\/li>\n<\/ol>\n<h3>\u5ba2\u6237\u7aef\u914d\u7f6e\u53c2\u6570<\/h3>\n<ul>\n<li><code>-s<\/code> : \u670d\u52a1\u5668\u5730\u5740\u4e0e\u7aef\u53e3\u3002<\/li>\n<li><code>-k<\/code> : \u5bc6\u7801\u3002<\/li>\n<li><code>-m<\/code> : \u52a0\u5bc6\u65b9\u5f0f\u3002<\/li>\n<\/ul>\n<h2>\u5e38\u89c1\u95ee\u9898\u89e3\u7b54<\/h2>\n<h3>1. Golang Shadowsocks \u53ef\u4ee5\u5728\u54ea\u4e9b\u7cfb\u7edf\u4e0a\u8fd0\u884c\uff1f<\/h3>\n<p>Golang Shadowsocks \u53ef\u4ee5\u5728\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\uff0c\u5305\u62ec Linux\u3001Windows \u548c macOS\u3002\u53ea\u8981\u5b89\u88c5\u4e86 Golang \u73af\u5883\uff0c\u5373\u53ef\u7f16\u8bd1\u548c\u8fd0\u884c\u3002<\/p>\n<h3>2. Shadowsocks \u7684\u52a0\u5bc6\u65b9\u5f0f\u6709\u54ea\u4e9b\uff1f<\/h3>\n<p>Shadowsocks \u652f\u6301\u591a\u79cd\u52a0\u5bc6\u65b9\u5f0f\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\uff1a<\/p>\n<ul>\n<li>aes-256-gcm<\/li>\n<li>aes-128-gcm<\/li>\n<li>chacha20-ietf-poly1305<\/li>\n<\/ul>\n<h3>3. \u5982\u4f55\u63d0\u9ad8 Shadowsocks \u7684\u5b89\u5168\u6027\uff1f<\/h3>\n<ul>\n<li>\u5b9a\u671f\u66f4\u6362\u5bc6\u7801\u3002<\/li>\n<li>\u4f7f\u7528\u5f3a\u5bc6\u7801\u548c\u5b89\u5168\u7684\u52a0\u5bc6\u65b9\u5f0f\u3002<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0 Shadowsocks \u7248\u672c\u3002<\/li>\n<\/ul>\n<h3>4. \u5728\u4f7f\u7528 Golang Shadowsocks \u65f6\uff0c\u5982\u4f55\u89e3\u51b3\u8fde\u63a5\u95ee\u9898\uff1f<\/h3>\n<ul>\n<li>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e\uff0c\u786e\u4fdd\u7aef\u53e3\u5f00\u653e\u3002<\/li>\n<li>\u786e\u4fdd\u670d\u52a1\u5668\u7684 Shadowsocks \u670d\u52a1\u6b63\u5728\u8fd0\u884c\u3002<\/li>\n<li>\u4f7f\u7528 <code>ping<\/code> \u548c <code>traceroute<\/code> \u5de5\u5177\u68c0\u67e5\u7f51\u7edc\u8fde\u901a\u6027\u3002<\/li>\n<\/ul>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u4f60\u5df2\u7ecf\u5bf9 <em>Golang Shadowsocks<\/em> \u6709\u4e86\u5168\u9762\u7684\u4e86\u89e3\u3002\u4e0d\u8bba\u662f\u670d\u52a1\u7aef\u7684\u642d\u5efa\u8fd8\u662f\u5ba2\u6237\u7aef\u7684\u4f7f\u7528\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u6b65\u9aa4\u5b9e\u73b0\u3002\u5728\u5f53\u524d\u4fe1\u606f\u5b89\u5168\u65e5\u76ca\u91cd\u8981\u7684\u65f6\u4ee3\uff0c\u4f7f\u7528 Shadowsocks \u4fdd\u62a4\u4f60\u7684\u7f51\u7edc\u9690\u79c1\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\u3002\u5e0c\u671b\u5927\u5bb6\u80fd\u591f\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u4eab\u53d7\u5230\u5b89\u5168\u548c\u81ea\u7531\u7684\u7f51\u7edc\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u73b0\u4ee3\u7f51\u7edc\u73af\u5883\u4e2d\uff0cGolang Shadowsocks \u6210\u4e3a\u4e86\u4e00\u79cd\u6d41\u884c\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3001\u4fdd\u62a4\u7f51\u7edc\u9690\u79c1\u7b49\u573a\u666f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Golang \u5b9e\u73b0 Shadowsocks\uff0c\u5305\u62ec\u5b89\u88c5\u6b65\u9aa4\u3001\u914d\u7f6e\u65b9\u6cd5\u548c\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\u3002 \u4ec0\u4e48\u662f Shadowsocks? Shadowsocks \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u7f51\u7edc\u4ee3\u7406\u5de5\u5177\uff0c\u5e38\u7528\u4e8e\u7a81\u7834\u7f51\u7edc\u9650\u5236\u548c\u4fdd\u62a4\u7528\u6237\u7684\u9690\u79c1\u3002\u5176\u539f\u7406\u662f\u901a\u8fc7\u52a0\u5bc6\u6280\u672f\uff0c\u5c06\u7528\u6237\u7684\u7f51\u7edc\u6d41\u91cf\u7ecf\u8fc7\u4ee3\u7406\u670d\u52a1\u5668\u8fdb\u884c\u8f6c\u53d1\u3002Golang \u4f5c\u4e3a\u4e00\u79cd\u9ad8\u6548\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u80fd\u591f\u9ad8\u6548\u5730\u5b9e\u73b0 Shadowsocks \u7684\u670d\u52a1\u7aef\u548c\u5ba2\u6237\u7aef\u3002 Golang Shadowsocks \u7684\u4f18\u52bf \u9ad8\u6027\u80fd: Golang \u7684\u5e76\u53d1\u5904\u7406\u80fd\u529b\u975e\u5e38\u5f3a\uff0c\u80fd\u591f\u5904\u7406\u5927\u91cf\u7684\u8fde\u63a5\u8bf7\u6c42\u3002 \u8de8\u5e73\u53f0: Golang \u7f16\u5199\u7684 Shadowsocks \u652f\u6301\u591a\u79cd\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5982 Linux\u3001Windows \u548c macOS\u3002 \u5f00\u6e90\u793e\u533a: \u6709\u5927\u91cf\u7684\u5f00\u6e90\u8d44\u6e90\u548c\u793e\u533a\u652f\u6301\uff0c\u6613\u4e8e\u5b66\u4e60\u548c\u4f7f\u7528\u3002 \u5982\u4f55\u5b89\u88c5 Golang Shadowsocks \u7cfb\u7edf\u9700\u6c42 \u5728\u5b89\u88c5 Golang Shadowsocks \u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86 Golang \u548c Git\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5b89\u88c5: bash go version git \u2013version \u5b89\u88c5\u6b65\u9aa4 \u4e0b\u8f7d\u4ee3\u7801: \u4f7f\u7528 Git \u514b\u9686 Shadowsocks \u7684 Golang \u5b9e\u73b0\u4ee3\u7801\u5e93\u3002 bash [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-56907","post","type-post","status-publish","format-standard","hentry","category-vpn"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=56907"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/56907\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=56907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=56907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=56907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}