{"id":614,"date":"2019-06-19T00:23:35","date_gmt":"2019-06-18T16:23:35","guid":{"rendered":"https:\/\/luke6887.me\/?p=614"},"modified":"2019-06-19T00:50:53","modified_gmt":"2019-06-18T16:50:53","slug":"%e6%94%b9%e4%ba%86%e4%b8%8b%e7%9a%84%e3%80%82%e3%80%82h2tlscaddy%e7%9a%84v2ray%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/blog.luke6887.me\/?p=614","title":{"rendered":"\u6539\u4e86\u4e0b\u7684\u3002\u3002h2+tls+caddy\u7684v2ray\u914d\u7f6e"},"content":{"rendered":"<p>\u6316\u5751.jpg<!--more--><\/p>\n<p>\u4ee5\u524d\u597d\u50cf\u5199\u8fc7\u4e00\u4e2a\u5f88\u50cf\u5f88\u50cf\u7684\u3002\u3002\u3002\u4eca\u5929\u521a\u642d\u597d\u5c31\u66f4\u65b0\u4e0b\u3002\u3002<\/p>\n<p>\u4e3b\u8981\u662f\u4e00\u4e9b\u7ec6\u8282\u4e0a\u662f\u5c0f\u95ee\u9898\u5427\u3002\u3002\u3002\u5176\u5b9e\u4e5f\u5c31\u4e00\u4e9b\u66f4\u65b0\u800c\u5df2\u3002\u3002<\/p>\n<p>1\uff1a\u539f\u6765\u662f\u80fd\u4e0d\u65ad\u5f00CDN\u7533\u8bf7\u8ddf\u66f4\u65b0\u8bc1\u4e66\u4e86\uff01\u770b\u8fd9\u4e2a\uff1a<\/p>\n<p>https:\/\/github.com\/Neilpang\/acme.sh\/wiki\/dnsapi<\/p>\n<p>\u7528dns api\u53bb\u7533\u8bf7\/\u66f4\u65b0\u3002\u3002<\/p>\n<p>2\uff1aCaddy\u7684\u5b89\u88c5\u548c\u8bbe\u7f6e\u670d\u52a1<\/p>\n<ul>\n<li>\u5728\u4e0b\u8f7d\u5b89\u88c5\u7684\u65f6\u5019\u5f97\u8bb0\u5f97\u9009\u4e0ahttp.proxyprotocol, http.forwardproxy\u548chook.service\u8fd9\u4e09\u4e2a\u63d2\u4ef6\u3002\u3002<\/li>\n<li>Caddy\u5b89\u88c5\u6210\u670d\u52a1\u53d8\u6210\u8fd9\u6837\u4e86\uff0c\u770b\u8fd9\u91cc\uff1a<\/li>\n<\/ul>\n<p>https:\/\/github.com\/hacdias\/caddy-service\/blob\/master\/README.md<\/p>\n<p>\u7136\u540e\u5176\u4ed6\u7684\u5c31\u662f\u8001\u751f\u5e38\u8c08\u4e86\u3002\u3002\u4e0d\u8fc7\u66f4\u65b0\u62104.x\u4ee5\u540e\u914d\u7f6e\u751f\u6210\u5668\u4e5f\u6709\u65b0\u7684\u4e86\uff0c\u611f\u8c22\u5927\u4f6c\u3002\u3002\u3002<\/p>\n<p>https:\/\/www.veekxt.com\/utils\/v2ray_gen<\/p>\n<p>*\u5178\u578b\u7684\u914d\u7f6e\uff1a<\/p>\n<p>\u5ba2\u6237\u7aef\uff1a<\/p>\n<pre class=\"lang:default decode:true \" title=\"Client\">{\r\n  \"log\":{},\r\n  \"dns\":{},\r\n  \"stats\":{},\r\n  \"inbounds\":[\r\n    {\r\n      \"settings\":{\r\n        \"auth\":\"noauth\",\r\n        \"udp\":true\r\n      },\r\n      \"protocol\":\"socks\",\r\n      \"port\":\"1080\",\r\n      \"tag\":\"in-0\"\r\n    },\r\n    {\r\n      \"settings\":{},\r\n      \"protocol\":\"http\",\r\n      \"port\":\"1081\",\r\n      \"tag\":\"in-1\"\r\n    }\r\n  ],\r\n  \"outbounds\":[\r\n    {\r\n      \"settings\":{\r\n        \"vnext\":[\r\n          {\r\n            \"address\":\"(\u4f60\u7684\u670d\u52a1\u5668\u57df\u540d)\",\r\n            \"port\":(\u4f60\u7684\u7aef\u53e3),\r\n            \"users\":[\r\n              {\r\n                \"alterId\":32,\r\n                \"id\":\"(user id)\"\r\n              }\r\n            ]\r\n          }\r\n        ]\r\n      },\r\n      \"protocol\":\"vmess\",\r\n      \"streamSettings\":{\r\n        \"security\":\"tls\",\r\n        \"httpSettings\":{\r\n          \"path\":\"(h2\u8def\u5f84)\",\r\n          \"host\":[\r\n            \"(h2\u57df\u540d)\"\r\n          ]\r\n        },\r\n        \"tlsSettings\":{\r\n          \"serverName\":\"(tls\u57df\u540d)\"\r\n        },\r\n        \"network\":\"http\"\r\n      },\r\n      \"tag\":\"out-0\"\r\n    },\r\n    {\r\n      \"tag\":\"direct\",\r\n      \"protocol\":\"freedom\",\r\n      \"settings\":{}\r\n    },\r\n    {\r\n      \"tag\":\"blocked\",\r\n      \"protocol\":\"blackhole\",\r\n      \"settings\":{}\r\n    }\r\n  ],\r\n  \"routing\":{\r\n    \"domainStrategy\":\"IPOnDemand\",\r\n    \"rules\":[\r\n      {\r\n        \"outboundTag\":\"direct\",\r\n        \"ip\":[\r\n          \"geoip:private\"\r\n        ],\r\n        \"type\":\"field\"\r\n      }\r\n    ]\r\n  },\r\n  \"policy\":{},\r\n  \"reverse\":{},\r\n  \"transport\":{}\r\n}<\/pre>\n<p>\u670d\u52a1\u7aef\u7684\u3002\u3002\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"Server\">{\r\n  \"log\": {\r\n    \"loglevel\": \"warning\",\r\n    \"error\": \"\/var\/log\/v2ray\/error.log\",\r\n    \"access\": \"\/var\/log\/v2ray\/access.log\"\r\n  },\r\n  \"dns\": {},\r\n  \"stats\": {},\r\n  \"inbounds\": [\r\n    {\r\n      \"settings\": {\r\n        \"clients\": [\r\n          {\r\n            \"alterId\": 32,\r\n            \"id\": \"(\u4f60\u7684user id)\"\r\n          }\r\n        ]\r\n      },\r\n      \"port\": (\u63a5Caddy\u7684\u7aef\u53e3),\r\n      \"tag\": \"in-0\",\r\n      \"streamSettings\": {\r\n        \"security\": \"tls\",\r\n        \"httpSettings\": {\r\n          \"path\": \"(h2\u7684\u8def\u5f84)\",\r\n          \"host\": [\r\n            \"(h2\u7684\u57df\u540d)\"\r\n          ]\r\n        },\r\n        \"tlsSettings\": {\r\n          \"certificates\": [\r\n            {\r\n              \"certificateFile\": \"\/etc\/v2ray\/v2ray.crt\",\r\n              \"keyFile\": \"\/etc\/v2ray\/v2ray.key\"\r\n            }\r\n          ]\r\n        },\r\n        \"network\": \"http\"\r\n      },\r\n      \"protocol\": \"vmess\",\r\n      \"listen\": \"127.0.0.1\"\r\n    }\r\n  ],\r\n  \"outbounds\": [\r\n    {\r\n      \"tag\": \"direct\",\r\n      \"protocol\": \"freedom\",\r\n      \"settings\": {}\r\n    },\r\n    {\r\n      \"tag\": \"blocked\",\r\n      \"protocol\": \"blackhole\",\r\n      \"settings\": {}\r\n    }\r\n  ],\r\n  \"routing\": {\r\n    \"domainStrategy\": \"AsIs\",\r\n    \"rules\": [\r\n      {\r\n        \"outboundTag\": \"blocked\",\r\n        \"ip\": [\r\n          \"geoip:private\"\r\n        ],\r\n        \"type\": \"field\"\r\n      }\r\n    ]\r\n  },\r\n  \"policy\": {},\r\n  \"reverse\": {},\r\n  \"transport\": {}\r\n}<\/pre>\n<p>\u6700\u540e\u662fCaddy\u7684\u3002\u3002\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"Caddyfile\">https:\/\/(\u4f60\u7684\u57df\u540d):(\u5bf9\u5ba2\u6237\u7aef\u7aef\u53e3) {\r\n    tls (\u4f60\u7684\u90ae\u7bb1)\r\n    root \/var\/www\/\r\n\r\n    proxy (h2\u8def\u5f84) https:\/\/127.0.0.1:(\u5bf9\u670d\u52a1\u7aefv2\u7684\u7aef\u53e3)  {\r\n        header_upstream Host \"(\u57df\u540d)\"\r\n        header_upstream X-Forwarded-Proto \"https\"\r\n        insecure_skip_verify\r\n    }\r\n}<\/pre>\n<p>\u55ef\u55ef\u3002\u3002\u3002\u5c31\u8fd9\u6837\u5427<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6316\u5751.jpg<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-614","post","type-post","status-publish","format-standard","hentry","category-gfw-stuff","category-servers"],"_links":{"self":[{"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/posts\/614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=614"}],"version-history":[{"count":8,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/posts\/614\/revisions"}],"predecessor-version":[{"id":622,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=\/wp\/v2\/posts\/614\/revisions\/622"}],"wp:attachment":[{"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.luke6887.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}