{"id":54979,"date":"2025-02-18T11:14:29","date_gmt":"2025-02-18T03:14:29","guid":{"rendered":"https:\/\/fwq.ai\/blog\/54979\/"},"modified":"2025-02-18T11:14:29","modified_gmt":"2025-02-18T03:14:29","slug":"%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90shadowsocks-go%e6%ba%90%e7%a0%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/54979\/","title":{"rendered":"\u6df1\u5165\u5206\u6790shadowsocks-go\u6e90\u7801"},"content":{"rendered":"<h2>\u4ec0\u4e48\u662fshadowsocks-go<\/h2>\n<p><em>Shadowsocks-go<\/em>\u662f\u4e00\u4e2a\u4f7f\u7528Go\u8bed\u8a00\u5f00\u53d1\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u4e3b\u8981\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3002\u76f8\u8f83\u4e8e\u4f20\u7edf\u7684Shadowsocks\uff0c\u5b83\u5177\u6709\u66f4\u9ad8\u7684\u6027\u80fd\u548c\u53ef\u6269\u5c55\u6027\u3002\u672c\u6587\u5c06\u6df1\u5165\u5206\u6790\u5176\u6e90\u7801\u7ed3\u6784\u53ca\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n<h2>shadowsocks-go\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h2>\n<h3>\u73af\u5883\u8981\u6c42<\/h3>\n<p>\u5728\u4f7f\u7528shadowsocks-go\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u73af\u5883\u8981\u6c42\u6ee1\u8db3\uff1a<\/p>\n<ul>\n<li>Go\u8bed\u8a00\u73af\u5883\uff1a\u81f3\u5c11\u9700\u8981Go 1.14\u53ca\u4ee5\u4e0a\u7248\u672c<\/li>\n<li>Git\u5de5\u5177\uff1a\u7528\u4e8e\u514b\u9686\u4ee3\u7801\u5e93<\/li>\n<\/ul>\n<h3>\u5b89\u88c5\u6b65\u9aa4<\/h3>\n<ol>\n<li><strong>\u514b\u9686\u4ee3\u7801\u5e93<\/strong>\uff1a\u4f7f\u7528Git\u514b\u9686shadowsocks-go\u6e90\u7801\uff1a<br \/> <code>git clone https:\/\/github.com\/shadowsocks\/shadowsocks-go.git<\/code><\/li>\n<li><strong>\u8fdb\u5165\u9879\u76ee\u76ee\u5f55<\/strong>\uff1a<br \/> <code>cd shadowsocks-go<\/code><\/li>\n<li><strong>\u6784\u5efa\u9879\u76ee<\/strong>\uff1a<br \/> <code>go build -o shadowsocks-go<\/code><\/li>\n<li><strong>\u8fd0\u884c\u7a0b\u5e8f<\/strong>\uff1a<br \/> <code>.\/shadowsocks-go -c config.json<\/code><\/li>\n<\/ol>\n<h2>shadowsocks-go\u6e90\u7801\u7ed3\u6784<\/h2>\n<p>shadowsocks-go\u7684\u6e90\u7801\u7ed3\u6784\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a<\/p>\n<ul>\n<li><strong>cmd<\/strong>\uff1a\u5305\u542b\u4e3b\u7a0b\u5e8f\u7684\u5165\u53e3\u4ee3\u7801<\/li>\n<li><strong>core<\/strong>\uff1a\u6838\u5fc3\u903b\u8f91\u6a21\u5757\uff0c\u5305\u62ec\u6570\u636e\u52a0\u5bc6\u548c\u89e3\u5bc6<\/li>\n<li><strong>protocol<\/strong>\uff1a\u534f\u8bae\u5c42\uff0c\u652f\u6301\u591a\u79cd\u4ee3\u7406\u534f\u8bae<\/li>\n<li><strong>server<\/strong>\uff1a\u670d\u52a1\u5668\u76f8\u5173\u7684\u5b9e\u73b0\uff0c\u5305\u62ecTCP\u548cUDP\u5904\u7406<\/li>\n<li><strong>client<\/strong>\uff1a\u5ba2\u6237\u7aef\u5b9e\u73b0\uff0c\u7ba1\u7406\u8fde\u63a5\u548c\u8bf7\u6c42<\/li>\n<li><strong>config<\/strong>\uff1a\u914d\u7f6e\u6587\u4ef6\u7684\u89e3\u6790\u548c\u7ba1\u7406<\/li>\n<\/ul>\n<h2>\u6838\u5fc3\u6a21\u5757\u89e3\u6790<\/h2>\n<h3>cmd\u76ee\u5f55<\/h3>\n<p>\u8be5\u76ee\u5f55\u4e2d\u5305\u542b\u4e86main.go\u6587\u4ef6\uff0c\u662fshadowsocks-go\u7684\u7a0b\u5e8f\u5165\u53e3\u3002\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u89e3\u6790\u547d\u4ee4\u884c\u53c2\u6570<\/li>\n<li>\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6<\/li>\n<li>\u542f\u52a8\u670d\u52a1\u5668\u6216\u5ba2\u6237\u7aef<\/li>\n<\/ul>\n<h3>core\u76ee\u5f55<\/h3>\n<p>\u5728core\u76ee\u5f55\u4e2d\uff0c\u4e3b\u8981\u7684\u4ee3\u7801\u6587\u4ef6\u6709\uff1a<\/p>\n<ul>\n<li><em>encrypt.go<\/em>\uff1a\u8d1f\u8d23\u6570\u636e\u7684\u52a0\u5bc6\u548c\u89e3\u5bc6\uff0c\u652f\u6301\u591a\u79cd\u52a0\u5bc6\u65b9\u5f0f<\/li>\n<li><em>stream.go<\/em>\uff1a\u5904\u7406\u6570\u636e\u6d41\u7684\u4f20\u8f93\u548c\u89e3\u6790<\/li>\n<\/ul>\n<h3>protocol\u76ee\u5f55<\/h3>\n<p>\u8be5\u76ee\u5f55\u4e2d\u5b9a\u4e49\u4e86\u4e0d\u540c\u7684\u4ee3\u7406\u534f\u8bae\u5b9e\u73b0\uff0c\u5982HTTP\u3001SOCKS5\u7b49\u3002\u6bcf\u4e2a\u534f\u8bae\u90fd\u6709\u81ea\u5df1\u7684\u5904\u7406\u903b\u8f91\u3002<br \/> \u5177\u4f53\u534f\u8bae\u6587\u4ef6\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><em>socks5.go<\/em>\uff1a\u5b9e\u73b0SOCKS5\u534f\u8bae\u7684\u5177\u4f53\u529f\u80fd<\/li>\n<li><em>http.go<\/em>\uff1a\u5b9e\u73b0HTTP\u4ee3\u7406\u7684\u529f\u80fd<\/li>\n<\/ul>\n<h2>shadowsocks-go\u7684\u529f\u80fd\u7279\u70b9<\/h2>\n<h3>\u9ad8\u6027\u80fd<\/h3>\n<p>shadowsocks-go\u5229\u7528Go\u8bed\u8a00\u7684\u5e76\u53d1\u7279\u6027\uff0c\u4f7f\u5f97\u5176\u5728\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\u65f6\u8868\u73b0\u51fa\u8272\u3002\u5176\u975e\u963b\u585e\u7684\u8bbe\u8ba1\u4f7f\u5f97\u7f51\u7edc\u8bf7\u6c42\u5904\u7406\u66f4\u52a0\u9ad8\u6548\u3002<\/p>\n<h3>\u8de8\u5e73\u53f0\u652f\u6301<\/h3>\n<p>shadowsocks-go\u53ef\u4ee5\u5728\u591a\u4e2a\u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u5305\u62ecWindows\u3001Linux\u548cmacOS\uff0c\u6781\u5927\u5730\u65b9\u4fbf\u4e86\u7528\u6237\u7684\u4f7f\u7528\u3002<\/p>\n<h3>\u7075\u6d3b\u7684\u914d\u7f6e<\/h3>\n<p>\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u81ea\u7531\u8bbe\u7f6e\u7aef\u53e3\u3001\u52a0\u5bc6\u65b9\u5f0f\u53ca\u5176\u4ed6\u53c2\u6570\uff0c\u6ee1\u8db3\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<h2>shadowsocks-go\u7684\u4f7f\u7528\u6280\u5de7<\/h2>\n<h3>\u9009\u62e9\u5408\u9002\u7684\u52a0\u5bc6\u65b9\u5f0f<\/h3>\n<p>\u5728\u914d\u7f6eshadowsocks-go\u65f6\uff0c\u9009\u62e9\u5408\u9002\u7684\u52a0\u5bc6\u65b9\u5f0f\u81f3\u5173\u91cd\u8981\u3002\u5e38\u89c1\u7684\u52a0\u5bc6\u65b9\u5f0f\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>AEAD\uff1a\u5bf9\u4e8e\u901f\u5ea6\u548c\u5b89\u5168\u6027\u6709\u8f83\u597d\u7684\u5e73\u8861<\/li>\n<li>ChaCha20-Poly1305\uff1a\u9002\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\uff0c\u6027\u80fd\u4f18\u8d8a<\/li>\n<\/ul>\n<h3>\u76d1\u63a7\u8fde\u63a5\u72b6\u6001<\/h3>\n<p>\u4f7f\u7528shadowsocks-go\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u65e5\u5fd7\u8bb0\u5f55\u8fde\u63a5\u72b6\u6001\uff0c\u5e2e\u52a9\u8c03\u8bd5\u548c\u4f18\u5316\u6027\u80fd\u3002<\/p>\n<h3>\u5e38\u7528\u547d\u4ee4<\/h3>\n<ul>\n<li>\u542f\u52a8\u670d\u52a1\u5668\uff1a<code>.\/shadowsocks-go -c config.json<\/code><\/li>\n<li>\u67e5\u770b\u5e2e\u52a9\uff1a<code>.\/shadowsocks-go -h<\/code><\/li>\n<\/ul>\n<h2>\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\uff08FAQ\uff09<\/h2>\n<h3>shadowsocks-go\u662f\u4ec0\u4e48\uff1f<\/h3>\n<p><em>Shadowsocks-go<\/em>\u662f\u4e00\u4e2a\u7528Go\u8bed\u8a00\u5f00\u53d1\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u4e3b\u8981\u7528\u4e8e\u7ffb\u5899\u548c\u4fdd\u62a4\u7528\u6237\u9690\u79c1\u3002<\/p>\n<h3>\u5982\u4f55\u914d\u7f6eshadowsocks-go\uff1f<\/h3>\n<p>\u7528\u6237\u9700\u8981\u521b\u5efa\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u6307\u5b9a\u7aef\u53e3\u3001\u52a0\u5bc6\u65b9\u5f0f\u53ca\u670d\u52a1\u5668\u5730\u5740\u7b49\u53c2\u6570\u3002<\/p>\n<h3>shadowsocks-go\u652f\u6301\u54ea\u4e9b\u5e73\u53f0\uff1f<\/h3>\n<p>shadowsocks-go\u652f\u6301\u591a\u4e2a\u5e73\u53f0\uff0c\u5305\u62ecWindows\u3001Linux\u548cmacOS\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u9009\u62e9\u3002<\/p>\n<h3>shadowsocks-go\u7684\u6027\u80fd\u5982\u4f55\uff1f<\/h3>\n<p>\u7531\u4e8e\u91c7\u7528Go\u8bed\u8a00\u7684\u9ad8\u6548\u5e76\u53d1\u5904\u7406\u673a\u5236\uff0cshadowsocks-go\u5728\u9ad8\u5e76\u53d1\u8bf7\u6c42\u4e0b\u4ecd\u80fd\u4fdd\u6301\u826f\u597d\u7684\u6027\u80fd\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u901a\u8fc7\u5bf9<em>shadowsocks-go\u6e90\u7801<\/em>\u7684\u6df1\u5165\u5206\u6790\uff0c\u8bfb\u8005\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u5176\u5de5\u4f5c\u539f\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u4f7f\u7528\u548c\u5f00\u53d1shadowsocks-go\u6709\u6240\u5e2e\u52a9\uff0c\u63d0\u5347\u7f51\u7edc\u5b89\u5168\u548c\u9690\u79c1\u4fdd\u62a4\u7684\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662fshadowsocks-go Shadowsocks-go\u662f\u4e00\u4e2a\u4f7f\u7528Go\u8bed\u8a00\u5f00\u53d1\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u4e3b\u8981\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3002\u76f8\u8f83\u4e8e\u4f20\u7edf\u7684Shadowsocks\uff0c\u5b83\u5177\u6709\u66f4\u9ad8\u7684\u6027\u80fd\u548c\u53ef\u6269\u5c55\u6027\u3002\u672c\u6587\u5c06\u6df1\u5165\u5206\u6790\u5176\u6e90\u7801\u7ed3\u6784\u53ca\u5de5\u4f5c\u539f\u7406\u3002 shadowsocks-go\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e \u73af\u5883\u8981\u6c42 \u5728\u4f7f\u7528shadowsocks-go\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u73af\u5883\u8981\u6c42\u6ee1\u8db3\uff1a Go\u8bed\u8a00\u73af\u5883\uff1a\u81f3\u5c11\u9700\u8981Go 1.14\u53ca\u4ee5\u4e0a\u7248\u672c Git\u5de5\u5177\uff1a\u7528\u4e8e\u514b\u9686\u4ee3\u7801\u5e93 \u5b89\u88c5\u6b65\u9aa4 \u514b\u9686\u4ee3\u7801\u5e93\uff1a\u4f7f\u7528Git\u514b\u9686shadowsocks-go\u6e90\u7801\uff1a git clone https:\/\/github.com\/shadowsocks\/shadowsocks-go.git \u8fdb\u5165\u9879\u76ee\u76ee\u5f55\uff1a cd shadowsocks-go \u6784\u5efa\u9879\u76ee\uff1a go build -o shadowsocks-go \u8fd0\u884c\u7a0b\u5e8f\uff1a .\/shadowsocks-go -c config.json shadowsocks-go\u6e90\u7801\u7ed3\u6784 shadowsocks-go\u7684\u6e90\u7801\u7ed3\u6784\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a cmd\uff1a\u5305\u542b\u4e3b\u7a0b\u5e8f\u7684\u5165\u53e3\u4ee3\u7801 core\uff1a\u6838\u5fc3\u903b\u8f91\u6a21\u5757\uff0c\u5305\u62ec\u6570\u636e\u52a0\u5bc6\u548c\u89e3\u5bc6 protocol\uff1a\u534f\u8bae\u5c42\uff0c\u652f\u6301\u591a\u79cd\u4ee3\u7406\u534f\u8bae server\uff1a\u670d\u52a1\u5668\u76f8\u5173\u7684\u5b9e\u73b0\uff0c\u5305\u62ecTCP\u548cUDP\u5904\u7406 client\uff1a\u5ba2\u6237\u7aef\u5b9e\u73b0\uff0c\u7ba1\u7406\u8fde\u63a5\u548c\u8bf7\u6c42 config\uff1a\u914d\u7f6e\u6587\u4ef6\u7684\u89e3\u6790\u548c\u7ba1\u7406 \u6838\u5fc3\u6a21\u5757\u89e3\u6790 cmd\u76ee\u5f55 \u8be5\u76ee\u5f55\u4e2d\u5305\u542b\u4e86main.go\u6587\u4ef6\uff0c\u662fshadowsocks-go\u7684\u7a0b\u5e8f\u5165\u53e3\u3002\u4e3b\u8981\u529f\u80fd\u5305\u62ec\uff1a \u89e3\u6790\u547d\u4ee4\u884c\u53c2\u6570 \u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6 \u542f\u52a8\u670d\u52a1\u5668\u6216\u5ba2\u6237\u7aef core\u76ee\u5f55 \u5728core\u76ee\u5f55\u4e2d\uff0c\u4e3b\u8981\u7684\u4ee3\u7801\u6587\u4ef6\u6709\uff1a encrypt.go\uff1a\u8d1f\u8d23\u6570\u636e\u7684\u52a0\u5bc6\u548c\u89e3\u5bc6\uff0c\u652f\u6301\u591a\u79cd\u52a0\u5bc6\u65b9\u5f0f stream.go\uff1a\u5904\u7406\u6570\u636e\u6d41\u7684\u4f20\u8f93\u548c\u89e3\u6790 protocol\u76ee\u5f55 \u8be5\u76ee\u5f55\u4e2d\u5b9a\u4e49\u4e86\u4e0d\u540c\u7684\u4ee3\u7406\u534f\u8bae\u5b9e\u73b0\uff0c\u5982HTTP\u3001SOCKS5\u7b49\u3002\u6bcf\u4e2a\u534f\u8bae\u90fd\u6709\u81ea\u5df1\u7684\u5904\u7406\u903b\u8f91\u3002 \u5177\u4f53\u534f\u8bae\u6587\u4ef6\u5305\u62ec\uff1a socks5.go\uff1a\u5b9e\u73b0SOCKS5\u534f\u8bae\u7684\u5177\u4f53\u529f\u80fd http.go\uff1a\u5b9e\u73b0HTTP\u4ee3\u7406\u7684\u529f\u80fd shadowsocks-go\u7684\u529f\u80fd\u7279\u70b9 \u9ad8\u6027\u80fd shadowsocks-go\u5229\u7528Go\u8bed\u8a00\u7684\u5e76\u53d1\u7279\u6027\uff0c\u4f7f\u5f97\u5176\u5728\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\u65f6\u8868\u73b0\u51fa\u8272\u3002\u5176\u975e\u963b\u585e\u7684\u8bbe\u8ba1\u4f7f\u5f97\u7f51\u7edc\u8bf7\u6c42\u5904\u7406\u66f4\u52a0\u9ad8\u6548\u3002 \u8de8\u5e73\u53f0\u652f\u6301 shadowsocks-go\u53ef\u4ee5\u5728\u591a\u4e2a\u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u5305\u62ecWindows\u3001Linux\u548cmacOS\uff0c\u6781\u5927\u5730\u65b9\u4fbf\u4e86\u7528\u6237\u7684\u4f7f\u7528\u3002 \u7075\u6d3b\u7684\u914d\u7f6e \u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u81ea\u7531\u8bbe\u7f6e\u7aef\u53e3\u3001\u52a0\u5bc6\u65b9\u5f0f\u53ca\u5176\u4ed6\u53c2\u6570\uff0c\u6ee1\u8db3\u4e0d\u540c\u7684\u4f7f\u7528\u573a\u666f\u3002 [&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-54979","post","type-post","status-publish","format-standard","hentry","category-vpn"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54979","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=54979"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54979\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=54979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=54979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=54979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}