{"id":2803,"date":"2018-09-05T16:47:55","date_gmt":"2018-09-05T08:47:55","guid":{"rendered":"http:\/\/blg.sofasay.com\/?p=2803"},"modified":"2019-04-23T21:43:47","modified_gmt":"2019-04-23T13:43:47","slug":"%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%e4%b9%8bfrp","status":"publish","type":"post","link":"http:\/\/blog.sofasay.com\/?p=2803","title":{"rendered":"\u5185\u7f51\u7a7f\u900f\u4e4bFRP"},"content":{"rendered":"<p>\u672c\u5730\u6709\u53f0PC\uff0c\u8fde\u7f51\u4f46\u6ca1\u516c\u7f51IP\uff0c\u60f3\u8981\u53d1\u5e03web\u670d\u52a1\u6216\u8fdc\u7a0b\u684c\u9762\u8fde\u63a5\uff0c\u9700\u8981\u5185\u7f51\u7a7f\u900f<\/p>\n<p>\u51c6\u5907\uff1a<\/p>\n<p>\u9996\u5148\u5f97\u6709\u53f0\u516c\u7f51IP\u7684\u4e3b\u673a\uff0c\u8fd9\u91cc\u9009\u62e9 digitalocean.com \u65b0\u52a0\u5761\u7684 VPS\uff0c\u6700\u4fbf\u5b9c\u7684 5\u5200\u6bcf\u6708\u3002\u521b\u5efa\u540e\u4f1a\u6536\u5230\u90ae\u4ef6\u544a\u77e5root\u7528\u6237\u7684\u5bc6\u7801 \uff08\u4f60\u7528ssh key\u767b\u9646\u4e5f\u53ef\u4ee5\uff09<\/p>\n<p><a href=\"http:\/\/space.sofasay.com\/wp-content\/uploads\/2018\/09\/image.png\"><img decoding=\"async\" style=\"--smush-placeholder-width: 603px; --smush-placeholder-aspect-ratio: 603\/536;display: inline; border-width: 0px;\" title=\"image\" data-src=\"http:\/\/space.sofasay.com\/wp-content\/uploads\/2018\/09\/image_thumb.png\" alt=\"image\" width=\"603\" height=\"536\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/a><\/p>\n<p><a href=\"http:\/\/space.sofasay.com\/wp-content\/uploads\/2018\/09\/image-1.png\"><img decoding=\"async\" class=\"alignnone lazyload\" style=\"--smush-placeholder-width: 602px; --smush-placeholder-aspect-ratio: 602\/218;display: inline; border-width: 0px;\" title=\"image\" data-src=\"http:\/\/space.sofasay.com\/wp-content\/uploads\/2018\/09\/image_thumb-1.png\" alt=\"image\" width=\"602\" height=\"218\" border=\"0\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/a><\/p>\n<p>\u7136\u540e\uff0c\u767b\u9646VPS\uff0c\u4e0b\u8f7d frp \u5bf9\u5e94\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff0c <a title=\"https:\/\/github.com\/fatedier\/frp\/releases\" href=\"https:\/\/github.com\/fatedier\/frp\/releases\">https:\/\/github.com\/fatedier\/frp\/releases<\/a> \u8fd9\u91cc\u6211\u7684VPS\u662f centos 7.4 64\u4f4d,\u00a0 \u6240\u4ee5\u9009 frp_0.21.0_linux_amd64.tar.gz 5.81 MB . \u89e3\u538b\u540e\u8fdb\u5165\u76ee\u5f55<\/p>\n<blockquote>\n<p>mkdir Downloads<\/p>\n<p>cd Downloads<\/p>\n<p>wegt <a href=\"https:\/\/github.com\/fatedier\/frp\/releases\/download\/v0.21.0\/frp_0.21.0_linux_amd64.tar.gz\">https:\/\/github.com\/fatedier\/frp\/releases\/download\/v0.21.0\/frp_0.21.0_linux_amd64.tar.gz<\/a><\/p>\n<p>tar \u2013xzvf frp_0.21.0_linux_amd64.tar.gz<\/p>\n<p>cd frp_0.21.0_linux_amd64<\/p><\/blockquote>\n<p>\u7136\u540e\uff0c\u6839\u636egithub\u4e0a\u7684\u8bf4\u660e\u6587\u6863\u4fee\u6539\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u6587\u4ef6 frps.ini , \u8fd9\u91cc\u4f60\u5f97\u6709\u4e2a\u57df\u540d(\u53ef\u4ee5\u662f\u4e8c\u7ea7\u57df\u540d), \u5c06\u5b83A\u8bb0\u5f55\u89e3\u6790\u5230VPS\u5730\u5740\u4e0a. \u7136\u540e\u8fd0\u884c .\/frps \u2013c frps.ini , \u8981\u540e\u53f0\u8fd0\u884c\u5c31 nohup .\/frps \u2013c frps.ini &amp;<\/p>\n<blockquote>\n<p>[common]<br \/>\nbind_port = 7000<br \/>\nvhost_http_port = 80<br \/>\nsubdomain_host = dodemo.com<\/p><\/blockquote>\n<p>\u7136\u540e,\u5728\u5185\u7f51\u673a\u5668\u4e0a,\u4e0b\u8f7d\u5bf9\u5e94\u7248\u672c\u7684frp, \u6bd4\u5982\u6211\u662f\u5728windows 64\u4f4d\u673a\u5668\u4e0a, \u5219\u4e0b\u8f7d frp_0.21.0_windows_amd64.zip 5.78 MB, \u89e3\u538b\u540e\u8fdb\u5165\u76ee\u5f55,\u4fee\u6539\u4fee\u6539\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6 frpc.ini \u5176\u4e2d [common]\u662f\u5fc5\u9700\u7684, \u4e0b\u9762\u7684\u6bcf\u4e2a[]\u79f0\u4e3aproxy,\u6ce8\u610f\u4e0d\u8981\u91cd\u540d. \u8fd0\u884c \u547d\u4ee4\u884c\u8fdb\u5165\u76ee\u5f55 \u8fd0\u884c frpc \u2013c frpc.ini \u5982\u679c\u4ee5\u4e0b\u63d0\u793a\u5219\u8868\u793a\u8fde\u63a5\u6210\u529f. \u5426\u5219\u68c0\u67e5\u7f51\u7edc\u6216\u4ee3\u7406\u6216\u9632\u706b\u5899\u6216\u8f6f\u4ef6\u7248\u672c\u662f\u5426\u4e00\u81f4<\/p>\n<p>[control.go:246] [fe2df7c9d9d20bbd] login to server success, get run id [fe2df7c9d9d20bbd], server udp port [0]<\/p>\n<p>\u53c2\u8003 frpc.ini<\/p>\n<blockquote>\n<p>[common]<br \/>\nserver_addr = dodemo.com<br \/>\nserver_port = 7000<br \/>\n#\u5185\u7f51\u8fde\u7f51\u9700\u8981\u4f7f\u7528\u4ee3\u7406<br \/>\nhttp_proxy = <a href=\"http:\/\/proxyserver.com:8080\">http:\/\/proxyserver.com:8080<\/a><\/p>\n<p>#\u4ee5\u4e0b\u914d\u7f6e\u5141\u8bb8windows\u8fdc\u7a0b\u684c\u9762 \u8bbf\u95ee\u5730\u5740 mstsc.dodemo.com<br \/>\n[mstsc]<br \/>\ntype = tcp<br \/>\nlocal_ip = 127.0.0.1<br \/>\nlocal_port = 3389<br \/>\nremote_port = 3389<br \/>\nsubdomain = mstsc<\/p>\n<p>#\u4ee5\u4e0b\u914d\u7f6e\u5141\u8bb8\u8bbf\u95ee\u672c\u673a\u63d0\u4f9b\u7684web\u670d\u52a1<br \/>\n[web1]<br \/>\ntype = http<br \/>\nlocal_ip = 127.0.0.1<br \/>\nlocal_port = 80<br \/>\nsubdomain = web1<\/p>\n<p>[web2]<br \/>\ntype = http<br \/>\nlocal_ip = 192.168.112.128<br \/>\nlocal_port = 81<br \/>\nsubdomain = web2<\/p>\n<p>#\u4ee5\u4e0b\u914d\u7f6e\u5141\u8bb8\u767b\u9646\u5c40\u57df\u7f51\u5185\u7684\u5176\u5b83\u673a\u5668<br \/>\n[vm_ssh]<br \/>\ntype = tcp<br \/>\nlocal_ip = 192.168.112.128<br \/>\nlocal_port = 22<br \/>\nremote_port = 6002<\/p>\n<p>#\u4ee5\u4e0b\u914d\u7f6e\u5141\u8bb8\u8bbf\u95ee\u672c\u673a\u53ef\u8bbf\u95ee\u7684\u5c40\u57df\u7f51\u63d0\u4f9b\u7684web\u670d\u52a1<br \/>\n[vm_web1]<br \/>\ntype = http<br \/>\nlocal_ip = 192.168.112.128<br \/>\nlocal_port = 80<br \/>\nsubdomain = vmweb1<br \/>\nhttp_user = admin<br \/>\nhttp_pwd = admin1<\/p>\n<p>[vm_web2]<br \/>\ntype = http<br \/>\nlocal_ip = 192.168.112.128<br \/>\nlocal_port = 81<br \/>\nsubdomain = vmweb2<\/p><\/blockquote>\n<p>FRP\u8fd8\u6709\u8bb8\u591a\u529f\u80fd,\u9002\u7528\u5c31\u597d. \u7528\u7c7b\u8fd8\u6709ngrok,\u4e0d\u4f5c\u6700\u4f18\u9009\u62e9. \u5176\u5b83\u5982\u82b1\u751f\u58f3,Nat123\u5df2\u6ca1\u843d,\u4ea4\u94b1\u670d\u52a1\u53ef\u80fd\u8fd8\u4e0d\u597d. pubyun, noip\u4ec0\u4e48\u7684\u4e5f\u5f88\u975e\u4e3b\u6d41. \u5982\u679c\u53ea\u6709\u4e00\u4e24\u4e2a\u8981\u7a7f\u900f\u7684\u670d\u52a1,\u4e5f\u4e0d\u5fc5\u81ea\u8d2dVPS, \u6709\u73b0\u6210\u7684 ngrok\u6216frp\u670d\u52a1,10\u5757\u94b1\u4e00\u4e2a\u6708\u8fd8\u662f\u53ef\u4ee5\u7684.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5730\u6709\u53f0PC\uff0c\u8fde\u7f51\u4f46\u6ca1\u516c\u7f51IP\uff0c\u60f3\u8981\u53d1\u5e03web\u670d\u52a1\u6216\u8fdc\u7a0b\u684c\u9762\u8fde\u63a5\uff0c\u9700\u8981\u5185\u7f51\u7a7f\u900f \u51c6\u5907\uff1a \u9996\u5148\u5f97\u6709\u53f0\u516c\u7f51IP\u7684\u4e3b &hellip; <a href=\"http:\/\/blog.sofasay.com\/?p=2803\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u5185\u7f51\u7a7f\u900f\u4e4bFRP\u201d<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[398],"tags":[],"views":929,"_links":{"self":[{"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=\/wp\/v2\/posts\/2803"}],"collection":[{"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2803"}],"version-history":[{"count":0,"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=\/wp\/v2\/posts\/2803\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2803"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sofasay.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}