mirror of
https://github.com/wjlin0/wjlin0.github.io.git
synced 2026-10-28 19:40:49 +00:00
1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
"use strict";(globalThis.webpackChunkblog=globalThis.webpackChunkblog||[]).push([[9555],{8308:(n,e,s)=>{s.d(e,{A:()=>r});const r=s.p+"assets/images/image-20221222233527949-a0052a7aa98cbe1c787e4157b602cda8.png"},28453:(n,e,s)=>{s.d(e,{R:()=>i,x:()=>t});var r=s(96540);const l={},c=r.createContext(l);function i(n){const e=r.useContext(c);return r.useMemo(function(){return"function"==typeof n?n(e):{...e,...n}},[e,n])}function t(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(l):n.components||l:i(n.components),r.createElement(c.Provider,{value:e},n.children)}},41027:(n,e,s)=>{s.r(e),s.d(e,{assets:()=>o,contentTitle:()=>t,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"\u4e2a\u4eba\u77e5\u8bc6\u5e93/\u5de5\u5177\u5206\u4eab/\u4ee3\u7406\u7c7b/\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51","title":"\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51","description":"|\u4f5c\u8005|\u4fee\u8ba2\u65f6\u95f4|","source":"@site/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/08.\u5de5\u5177\u5206\u4eab/03.\u4ee3\u7406\u7c7b/01.\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51.md","sourceDirName":"\u4e2a\u4eba\u77e5\u8bc6\u5e93/08.\u5de5\u5177\u5206\u4eab/03.\u4ee3\u7406\u7c7b","slug":"/\u4e2a\u4eba\u77e5\u8bc6\u5e93/\u5de5\u5177\u5206\u4eab/\u4ee3\u7406\u7c7b/\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/\u5de5\u5177\u5206\u4eab/\u4ee3\u7406\u7c7b/\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/08.\u5de5\u5177\u5206\u4eab/03.\u4ee3\u7406\u7c7b/01.\u57fa\u4e8evless\u7684\u79d1\u5b66\u4e0a\u7f51.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"\u5b89\u88c5Gitbook","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/\u5de5\u5177\u5206\u4eab/GitBook\u5b89\u88c5/"},"next":{"title":"\u4f7f\u7528\u4e91\u51fd\u6570\u505a\u4ee3\u7406","permalink":"/docs/\u4e2a\u4eba\u77e5\u8bc6\u5e93/\u5de5\u5177\u5206\u4eab/\u4ee3\u7406\u7c7b/\u4f7f\u7528\u4e91\u51fd\u6570\u505a\u4ee3\u7406"}}');var l=s(74848),c=s(28453);const i={},t="\u57fa\u4e8exray\u7684\u79d1\u5b66\u4e0a\u7f51",o={},d=[{value:"\u524d\u6cbf",id:"\u524d\u6cbf",level:2},{value:"\u51c6\u5907\u5de5\u5177",id:"\u51c6\u5907\u5de5\u5177",level:2},{value:"\u5b89\u88c5",id:"\u5b89\u88c5",level:2},{value:"\u5b89\u88c5\u5de5\u5177",id:"\u5b89\u88c5\u5de5\u5177",level:3},{value:"\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6",id:"\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6",level:3},{value:"\u65b0\u5efa\u6587\u4ef6\u5939",id:"\u65b0\u5efa\u6587\u4ef6\u5939",level:4},{value:"config.json",id:"configjson",level:4},{value:"ssl(\u76ee\u5f55)",id:"ssl\u76ee\u5f55",level:4},{value:"start.sh",id:"startsh",level:4},{value:"web.conf",id:"webconf",level:4},{value:"\u914d\u7f6e\u5b8c\u6210\u540e\u5927\u81f4\u4e3a",id:"\u914d\u7f6e\u5b8c\u6210\u540e\u5927\u81f4\u4e3a",level:4},{value:"\u5236\u4f5cdocker-compose \u542f\u52a8\u6587\u4ef6",id:"\u5236\u4f5cdocker-compose-\u542f\u52a8\u6587\u4ef6",level:3},{value:"\u542f\u52a8",id:"\u542f\u52a8",level:3},{value:"\u67e5\u770b\u72b6\u6001",id:"\u67e5\u770b\u72b6\u6001",level:3},{value:"\u5ba2\u6237\u7aef\u9009\u62e9",id:"\u5ba2\u6237\u7aef\u9009\u62e9",level:2},{value:"\u8ba2\u9605\u94fe\u63a5\u8bbe\u7f6e",id:"\u8ba2\u9605\u94fe\u63a5\u8bbe\u7f6e",level:2}];function a(n){const e={a:"a",blockquote:"blockquote",code:"code",del:"del",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,c.R)(),...n.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(e.table,{children:[(0,l.jsx)(e.thead,{children:(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.th,{style:{textAlign:"left"},children:"\u4f5c\u8005"}),(0,l.jsx)(e.th,{style:{textAlign:"left"},children:"\u4fee\u8ba2\u65f6\u95f4"})]})}),(0,l.jsx)(e.tbody,{children:(0,l.jsxs)(e.tr,{children:[(0,l.jsx)(e.td,{style:{textAlign:"left"},children:(0,l.jsx)(e.img,{src:"https://img.shields.io/badge/wjlin0-%E4%B8%AA%E4%BA%BA%E7%9F%A5%E8%AF%86%E5%BA%93-green",alt:"wjlin0"})}),(0,l.jsx)(e.td,{style:{textAlign:"left"},children:"2024-01-12 00:01:36"})]})})]}),"\n",(0,l.jsx)(e.header,{children:(0,l.jsx)(e.h1,{id:"\u57fa\u4e8exray\u7684\u79d1\u5b66\u4e0a\u7f51",children:"\u57fa\u4e8exray\u7684\u79d1\u5b66\u4e0a\u7f51"})}),"\n",(0,l.jsx)(e.h2,{id:"\u524d\u6cbf",children:"\u524d\u6cbf"}),"\n",(0,l.jsxs)(e.p,{children:["\u56fd\u5185\u7684\u5f88\u591a\u4e1c\u897f\u90fd\u662f",(0,l.jsx)(e.del,{children:"\u9609\u5272\u4e86\u7684"}),"\uff0c\u4e3a\u4e86\u5b66\u4e60\u8fd8\u662f\u9700\u8981\u61c2\u5f97\u79d1\u5b66\u4e0a\u7f51"]}),"\n",(0,l.jsx)(e.h2,{id:"\u51c6\u5907\u5de5\u5177",children:"\u51c6\u5907\u5de5\u5177"}),"\n",(0,l.jsxs)(e.ul,{children:["\n",(0,l.jsx)(e.li,{children:"docker\u3001docker-compose"}),"\n",(0,l.jsx)(e.li,{children:"(ubuntu\u3001centos\u90fd\u53ef\u4ee5) vps\u3001\u57df\u540d"}),"\n"]}),"\n",(0,l.jsx)(e.h2,{id:"\u5b89\u88c5",children:"\u5b89\u88c5"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u6211\u5df2\u7ecf\u628a docker \u955c\u50cf\u5236\u4f5c\u597d\u4e86\uff0c\u6240\u4ee5 \u5f88\u7b80\u5355\u7684\u53ea\u9700\u8981\u4fee\u6539\u51e0\u4e2a\u5c0f\u5730\u65b9\u5c31\u53ef\u4ee5\u98df\u7528\u4e86"}),"\n"]}),"\n",(0,l.jsx)(e.h3,{id:"\u5b89\u88c5\u5de5\u5177",children:"\u5b89\u88c5\u5de5\u5177"}),"\n",(0,l.jsx)(e.p,{children:"\u5b89\u88c5docker\uff1a"}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.code,{children:"curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun"})}),"\n",(0,l.jsx)(e.p,{children:"\u5b89\u88c5docker-compose\uff1a"}),"\n",(0,l.jsxs)(e.p,{children:[(0,l.jsx)(e.code,{children:"curl -L https://get.daocloud.io/docker/compose/releases/download/v2.4.1/docker-compose-"}),"uname -s",(0,l.jsx)(e.code,{children:"-"}),"uname -m",(0,l.jsx)(e.code,{children:" > /usr/local/bin/docker-compose"})]}),"\n",(0,l.jsx)(e.p,{children:"docker\u5f00\u673a\u81ea\u542f\u52a8\uff1a"}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:"systemctl start docker && systemctl enable docker\n"})}),"\n",(0,l.jsx)(e.h3,{id:"\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6",children:"\u914d\u7f6e\u914d\u7f6e\u6587\u4ef6"}),"\n",(0,l.jsx)(e.h4,{id:"\u65b0\u5efa\u6587\u4ef6\u5939",children:"\u65b0\u5efa\u6587\u4ef6\u5939"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsxs)(e.p,{children:["\u65b0\u5efa\u6587\u4ef6\u5939\u540e\u6dfb\u52a0\u4ee5\u4e0b\u6807\u9898\u7684\u6587\u4ef6",(0,l.jsx)(e.code,{children:" config.json\u3001ssl(\u76ee\u5f55)\u3001start.sh\u3001web.conf"})]}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:"mkdir conf/\n"})}),"\n",(0,l.jsx)(e.h4,{id:"configjson",children:"config.json"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"xray\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5c06\u91cc\u9762\u7684id\u3001\u8bc1\u4e66\u540d\u79f0\u66ff\u6362\u6210\u4f60\u7684\uff0c\u5176\u4ed6\u7684\u4e0d\u9700\u8981\u52a8"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{className:"language-json",children:'{\n "log": {\n\n\n "loglevel": "warning"\n },\n "inbounds": [\n {\n "port": 443,\n "protocol": "vless",\n "settings": {\n "clients": [\n {\n "id": "\u8fd9\u91cc\u9700\u8981\u586b\u5199\u4f60\u7684id",\n "flow": "xtls-rprx-direct"\n }\n ],\n "decryption": "none",\n "fallbacks": [\n {\n "dest": 60000,\n "alpn": "",\n "xver": 1\n },\n {\n "dest": 60001,\n "alpn": "h2",\n "xver": 1\n }\n ]\n },\n "streamSettings": {\n "network": "tcp",\n "security": "xtls",\n "xtlsSettings": {\n "minVersion": "1.2",\n "certificates": [\n {\n "certificateFile": "/conf/ssl/\u8fd9\u91cc\u9700\u8981\u586b\u5199\u4f60\u7684\u8bc1\u4e66\u516c\u94a5\u540d\u79f0.crt",\n "keyFile": "/conf/ssl/\u8fd9\u91cc\u586b\u5199\u4f60\u7684\u8bc1\u4e66\u79c1\u94a5\u540d\u79f0.key"\n }\n ]\n }\n },\n "sniffing": {\n "enabled": true,\n "destOverride": [\n "http",\n "tls"\n ]\n }\n }\n ],\n "outbounds": [\n {\n "protocol": "freedom"\n }\n ]\n}\n'})}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.strong,{children:"\u6ce8\u610f\uff1a\u8fd9\u91cc\u8bc1\u4e66\u8def\u5f84\u4e3a/conf/ssl/exp.crt\u7b49"})}),"\n",(0,l.jsx)(e.h4,{id:"ssl\u76ee\u5f55",children:"ssl(\u76ee\u5f55)"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u5728\u8be5\u76ee\u5f55\u4e0b\u5b58\u653e\u4f60\u7684\u516c\u79c1\u94a5,\u5927\u81f4\u5982\u4e0b\u56fe"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:"ssl/exp.crt\nssl/exp.key\n"})}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"image-20221222233933291",src:s(63457).A+"",width:"789",height:"143"})}),"\n",(0,l.jsx)(e.h4,{id:"startsh",children:"start.sh"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u542f\u52a8\u811a\u672c\uff0c\u53ef\u4ee5\u4e0d\u9700\u8981\u66f4\u6539\u5982\u4e0b\u5373\u53ef"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{className:"language-bash",children:"#!/bin/bash\ncp /conf/web.conf /etc/nginx/conf.d/ && \\\n service nginx restart && \\\n mv /var/www/html/index.nginx-debian.html /var/www/html/index.html && \\\n /data/xray/xray run -config /conf/config.json\n"})}),"\n",(0,l.jsx)(e.h4,{id:"webconf",children:"web.conf"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u5c06\u5176\u4e2d\u7684\u57df\u540d\u66ff\u6362\u6210\u4f60\u7684"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:'server\n{\n listen 80;\n listen [::]:80;\n server_name \u4f60\u7684\u57df\u540d;\n return 301 https://$http_host$request_uri;\n\n access_log /dev/null;\n error_log /dev/null;\n}\n\nserver\n{\n listen 127.0.0.1:60000 proxy_protocol;\n listen 127.0.0.1:60001 http2 proxy_protocol;\n server_name \u4f60\u7684\u57df\u540d;\n index index.html index.htm index.php default.php default.htm default.html;\n root /var/www/html;\n add_header Strict-Transport-Security "max-age=63072000" always;\n\n location ~ .*\\.(gif|jpg|jpeg|png|bmp|swf)$\n {\n expires 30d;\n error_log off;\n }\n\n location ~ .*\\.(js|css)?$\n {\n expires 12h;\n error_log off;\n }\n}\n'})}),"\n",(0,l.jsx)(e.h4,{id:"\u914d\u7f6e\u5b8c\u6210\u540e\u5927\u81f4\u4e3a",children:"\u914d\u7f6e\u5b8c\u6210\u540e\u5927\u81f4\u4e3a"}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"image-20221222232309364",src:s(57466).A+"",width:"538",height:"129"})}),"\n",(0,l.jsx)(e.h3,{id:"\u5236\u4f5cdocker-compose-\u542f\u52a8\u6587\u4ef6",children:"\u5236\u4f5cdocker-compose \u542f\u52a8\u6587\u4ef6"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"docker-compose.yml \u6211\u8fd9\u91cc\u542f\u52a8\u4e864\u4e2a\uff0c\u5982\u679c\u4f60\u7684vps\u5185\u5b58\u7a7a\u95f2\u53ef\u4ee5\u591a\u542f\u52a8\u5373\u53ef\uff0c\u9632\u6b62\u6302\u6389\u3002"}),"\n",(0,l.jsx)(e.p,{children:"1001\u30011002\u30011003\u30011004 \u5c31\u662f\u4f60\u8bbe\u7f6e\u7684\u7aef\u53e3\uff0c\u53ef\u4ee5\u6309\u7167\u4f60\u7684\u4e60\u60ef\u6765"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{className:"language-yaml",children:'version: "3"\nservices:\n xray1:\n image: wjlin0/xray:v1\n restart: always\n hostname: xray\n container_name: xray1\n ports:\n - "1001:443"\n volumes:\n - ./conf:/conf\n command: ["/bin/bash","/conf/start.sh"]\n xray2:\n image: wjlin0/xray:v1\n restart: always\n hostname: xray\n container_name: xray2\n ports:\n - "1002:443"\n volumes:\n - ./conf:/conf\n command: ["/bin/bash","/conf/start.sh"]\n xray3:\n image: wjlin0/xray:v1\n restart: always\n hostname: xray\n container_name: xray3\n ports:\n - "1003:443"\n volumes:\n - ./conf:/conf\n command: ["/bin/bash","/conf/start.sh"]\n xray4:\n image: wjlin0/xray:v1\n restart: always\n hostname: xray\n container_name: xray4\n ports:\n - "1004:443"\n volumes:\n - ./conf:/conf\n command: ["/bin/bash","/conf/start.sh"]\n'})}),"\n",(0,l.jsx)(e.h3,{id:"\u542f\u52a8",children:"\u542f\u52a8"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u5728docker-compose.yml \u76ee\u5f55\u4e0b"}),"\n"]}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"image-20221222233527949",src:s(8308).A+"",width:"717",height:"88"})}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:"docker-compose up -d\n"})}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"image-20221222233609264",src:s(42233).A+"",width:"1306",height:"147"})}),"\n",(0,l.jsx)(e.h3,{id:"\u67e5\u770b\u72b6\u6001",children:"\u67e5\u770b\u72b6\u6001"}),"\n",(0,l.jsxs)(e.blockquote,{children:["\n",(0,l.jsx)(e.p,{children:"\u82e5\u51fa\u73b0\u4e0b\u5217\u56fe\u7247\u4e2d\u7684\u60c5\u51b5\u5219\u4e3a\u542f\u52a8\u6210\u529f\u4e86"}),"\n"]}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{className:"language-yaml",children:"docker-compose logs\n"})}),"\n",(0,l.jsx)(e.p,{children:(0,l.jsx)(e.img,{alt:"image-20221222233803640",src:s(90163).A+"",width:"1165",height:"490"})}),"\n",(0,l.jsx)(e.h2,{id:"\u5ba2\u6237\u7aef\u9009\u62e9",children:"\u5ba2\u6237\u7aef\u9009\u62e9"}),"\n",(0,l.jsxs)(e.ul,{children:["\n",(0,l.jsxs)(e.li,{children:["windows\uff1a",(0,l.jsx)(e.a,{href:"https://www.qv2ray.com/",children:"winxray"}),"\u3001",(0,l.jsx)(e.a,{href:"https://github.com/2dust/v2rayN",children:"v2rayN"})]}),"\n",(0,l.jsxs)(e.li,{children:["linux\uff1a",(0,l.jsx)(e.a,{href:"https://v2raya.org/",children:"v2rayA"})]}),"\n",(0,l.jsxs)(e.li,{children:["ios\uff1a",(0,l.jsx)(e.a,{href:"https://shadowrocket.gitbook.io/shadowrocket/help",children:"Shadowrocket"})," # \u8fd9\u4e2a\u8981\u94b1\uff0c\u7f51\u4e0a\u627e\u4e00\u4e0b\u6559\u7a0b"]}),"\n",(0,l.jsxs)(e.li,{children:["\u5b89\u5353\uff1a",(0,l.jsx)(e.a,{href:"https://github.com/2dust/v2rayNG",children:"V2rayNG"})]}),"\n",(0,l.jsxs)(e.li,{children:["Mac\uff1a",(0,l.jsx)(e.a,{href:"https://iyideng.net/tools/qv2ray.html",children:"Qv2ray"})]}),"\n"]}),"\n",(0,l.jsx)(e.h2,{id:"\u8ba2\u9605\u94fe\u63a5\u8bbe\u7f6e",children:"\u8ba2\u9605\u94fe\u63a5\u8bbe\u7f6e"}),"\n",(0,l.jsx)(e.pre,{children:(0,l.jsx)(e.code,{children:"vless://\u4f60\u7684ID@\u4f60\u7684\u57df\u540d:\u4f60\u8bbe\u7f6e\u7684\u7aef\u53e3?flow=xtls-rprx-direct&host=&security=xtls&sni=\n"})})]})}function h(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,l.jsx)(e,{...n,children:(0,l.jsx)(a,{...n})}):a(n)}},42233:(n,e,s)=>{s.d(e,{A:()=>r});const r=s.p+"assets/images/image-20221222233609264-407896cf6331126744df11bcd118b839.png"},57466:(n,e,s)=>{s.d(e,{A:()=>r});const r=s.p+"assets/images/image-20221222232309364-b6294a7774aa906fee4022a584f36bf1.png"},63457:(n,e,s)=>{s.d(e,{A:()=>r});const r=s.p+"assets/images/image-20221222233933291-e67d6a2a97b95efc13570ea11d639671.png"},90163:(n,e,s)=>{s.d(e,{A:()=>r});const r=s.p+"assets/images/image-20221222233803640-55cc2a0cdebd13c25e2b30c7d5a61417.png"}}]); |