{"id":99,"date":"2016-03-29T23:43:59","date_gmt":"2016-03-29T15:43:59","guid":{"rendered":"http:\/\/blog.bilicloud.com\/?p=99"},"modified":"2016-03-29T23:43:59","modified_gmt":"2016-03-29T15:43:59","slug":"%e4%bd%bf%e7%94%a8socat%e5%81%9a%e7%ab%af%e5%8f%a3%e8%bd%ac%e5%8f%91","status":"publish","type":"post","link":"https:\/\/blog.foxsar.black\/?p=99","title":{"rendered":"\u4f7f\u7528socat\u505a\u7aef\u53e3\u8f6c\u53d1"},"content":{"rendered":"<p>\t\t\t\t\u7531\u4e8e\u5de5\u4f5c\u9700\u8981\uff0c\u8981\u90e8\u7f72\u4e00\u4e2aminecraft\u7684\u670d\u52a1\u5668\uff08\u5c31\u662f\u4f20\u8bf4\u4e2d\u7684bilicraft~\uff09\uff0c\u90e8\u7f72\u597d\u4e86\u540e\u53d1\u73b0\u3002\u3002\u3002\u72d7\u65e5\u7684\u6c5f\u82cf\u7535\u4fe1\u3002\u3002\u3002\u5357\u4e0b\u5230\u4e0a\u6d77\/\u5e7f\u4e1c\u65b9\u5411\u7684\u9aa8\u5e72\u6709\u95ee\u9898\u3002\u3002\u3002\u53ea\u597d\u505a\u4e00\u4e2a\u7aef\u53e3\u8f6c\u53d1\u6765\u8ba9\u7528\u6237\u80fd\u987a\u5229\u8bbf\u95ee\u4e86<br \/>\n\u672c\u6765\u662f\u6253\u7b97\u7528iptables\u6765\u505a\u7684\uff0c\u7ed3\u679c\u53d1\u73b0\u4e86\u4e00\u4e2a\u5f88\u795e\u5947\u7684\u95ee\u9898\uff0c\u6211\u81ea\u5df1\u7684\u65e5\u672c\u7684\u670d\u52a1\u5668\uff08\u5c31\u662f\u73b0\u5728blog\u7528\u7684\u8fd9\u53f0\uff09\u5199\u597diptables\u540e\u53ef\u4ee5\u7528\uff0c\u4f46\u662f\u56fd\u5185\u7684\u670d\u52a1\u5668\u5374\u4e0d\u884c\uff0c\u7814\u7a76\u4e862\u5929\uff0c\u5e76\u4e0d\u77e5\u9053\u539f\u56e0\u5728\u54ea\u91cc\uff08\u4e3b\u8981\u662f\u4e0a\u9762\u8fd8\u6709\u4e3b\u7ad9\u7684\u4e1a\u52a1\uff0c\u5982\u679c\u6e05\u6389\u6240\u6709\u7684iptables\u91cd\u6765\u7684\u8bdd\u6211\u89c9\u5f97\u6211\u4f1a\u6b7b\u3002\u3002\u3002\uff09<br \/>\n\u4e8e\u662f\u81ea\u5df1google+\u8bf7\u6559\u4e86\u8001\u5927\uff0c\u5f97\u5230\u4e86\u51e0\u4e2a\u59ff\u52bf\uff1aredir\/socat\/xinetd<br \/>\n\u603b\u7ed3\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0\u4e86\u51e0\u4e2a\u95ee\u9898<br \/>\nredir\uff1a\u7b80\u5355\uff0c\u4f46\u662f\u4e0d\u652f\u6301UDP\uff0cMC\u7684\u670d\u52a1\u7aef\u867d\u7136\u5f88\u5c11\u89c1\uff0c\u4f46\u662f\u4ecd\u7136\u4f1a\u7528\u5230UDP<br \/>\nsocat\uff1a\u652f\u6301UDP\uff0c\u652f\u6301ipv6\uff0c\u53ea\u662f\u8001\u5927\u7684blog\u5c45\u7136\u6ca1\u5199\u600e\u4e48\u7528\u3002\u3002\u3002\u6211\u53ea\u597d\u81ea\u5df1\u53bb\u641c\uff08\u641c\u5230\u540e\u53d1\u73b0\u5176\u5b9e\u5f02\u5e38\u7b80\u5355\uff09<br \/>\nxinetd\uff1a\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u662f\u3002\u3002\u3002\u597d\u590d\u6742\uff0c\u8981\u5199\u914d\u7f6e\u6587\u4ef6\uff0c\u53cd\u6b63\u53ea\u662fmc\uff0c\u8981\u6c42\u6ca1\u90a3\u4e48\u9ad8\uff0c\u6ca1\u5fc5\u8981\u4e0a\u8fd9\u4e2a<br \/>\n\u4e8e\u662f\u4e4e\u91c7\u7528\u4e86socat<br \/>\n1\u3001\u5b89\u88c5\u5c31\u4e0d\u7528\u8bf4\u4e86\uff0c\u76f4\u63a5<\/p>\n<pre>apt-get install socat<\/pre>\n<p>2\u3001\u8d77\u4e00\u4e2ascreen\uff0c\u6ca1\u6709\u7684\u8bdd\u5b89\u88c5\u4e00\u4e2a<\/p>\n<pre>screen -S socat-tcp<\/pre>\n<p>3\u3001\u8d77socat<\/p>\n<pre>socat TCP4-LISTEN:25565,fork TCP4:1.2.3.4:25565<\/pre>\n<p>\u5176\u4e2d\uff1aTCP4 #TCP\u7aef\u53e3ipv4\u534f\u8bae<br \/>\n25565 #MC\u7684\u7aef\u53e3\uff0c\u6362\u6210\u4f60\u8981\u8f6c\u53d1\u7684\u7aef\u53e3\u5373\u53ef<br \/>\nfork #\u591a\u94fe\u63a5\u6a21\u5f0f\uff0c\u5f53\u6709\u4e00\u4e2a\u4eba\u8fde\u4e0a\u6765\u540e\uff0c\u590d\u5236\u4e00\u4e2a\u540c\u6837\u7684\u7aef\u53e3\u7ee7\u7eed\u76d1\u542c<br \/>\n1.2.3.4:25565 #\u76ee\u6807IP\u548c\u7aef\u53e3\uff0c\u4e0d\u89e3\u91ca<br \/>\n\u6309\u4e0b\u56de\u8f66\u540e\u4e0d\u4f1a\u6709\u4efb\u4f55\u63d0\u793a\uff0c\u76f4\u63a5ctrl+ad\u9000\u51fa\u8fd9\u4e2ascreen\u5373\u53ef\uff0c\u8ba9\u4ed6\u5728\u540e\u53f0\u9759\u9759\u7684\u8fd0\u884c\u5427\u3002\u3002\u3002<br \/>\n\u56e0\u4e3aMC\u8fd8\u9700\u8981\u4e00\u4e2aUDP\u7aef\u53e3\uff0c\u7136\u540e\u91cd\u590d2-3\uff0cTCP4\u6539\u6210UDP4\u7136\u540e\u8d77\u670d\u52a1\u5373\u53ef<br \/>\n\u8fd9\u6837\u5c31\u53ef\u4ee5\u6bd4\u8f83\u65b9\u4fbf\u7684\u5f04\u597d\u7aef\u53e3\u8f6c\u53d1\u4e86~BC\u4eec\u7684\u73a9\u5bb6\u53c8\u56de\u5230\u4e86\u6d41\u7545\u7684\u65e5\u5b50\u4e86\uff08\u7b11\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8e\u5de5\u4f5c\u9700\u8981\uff0c\u8981\u90e8\u7f72\u4e00\u4e2aminecraft\u7684\u670d\u52a1\u5668\uff08\u5c31\u662f\u4f20\u8bf4\u4e2d\u7684bilicraft~\uff09\uff0c\u90e8\u7f72\u597d\u4e86\u540e\u53d1\u73b0\u3002\u3002\u3002\u72d7 &hellip; <a href=\"https:\/\/blog.foxsar.black\/?p=99\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u4f7f\u7528socat\u505a\u7aef\u53e3\u8f6c\u53d1<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":1,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.foxsar.black\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}