portal.jsonc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. "log": {
  3. "loglevel": "warning"
  4. },
  5. "reverse": {
  6. "portals": [
  7. {
  8. "tag": "portal",
  9. "domain": "reverse.proxy"
  10. }
  11. ]
  12. },
  13. "inbounds": [
  14. {
  15. "tag": "external",
  16. "port": 443,
  17. "protocol": "vless",
  18. "settings": {
  19. "clients": [
  20. {
  21. "id": "", //填写你的 UUID
  22. "flow": "xtls-rprx-direct",
  23. "level": 0,
  24. "email": "@external"
  25. }
  26. ],
  27. "decryption": "none",
  28. "fallbacks": [
  29. {
  30. "dest": 80
  31. },
  32. {
  33. "path": "/interconn", // 对应下面的 interconn 中的 PATH
  34. "dest": 65510,
  35. "xver": 1
  36. },
  37. {
  38. "path": "/externalws", // 对应下面的 externalws 中的 PATH
  39. "dest": 65511,
  40. "xver": 1
  41. }
  42. ]
  43. },
  44. "streamSettings": {
  45. "network": "tcp",
  46. "security": "xtls",
  47. "xtlsSettings": {
  48. "alpn": [
  49. "http/1.1"
  50. ],
  51. "certificates": [
  52. {
  53. "certificateFile": "./fullchain.crt", // 换成你的证书,绝对路径
  54. "keyFile": "./private.key" // 换成你的私钥,绝对路径
  55. }
  56. ]
  57. }
  58. }
  59. },
  60. {
  61. "tag": "externalws",
  62. "port": 65511,
  63. "listen": "::1",
  64. "protocol": "vless",
  65. "settings": {
  66. "clients": [
  67. {
  68. "id": "", // 填写你的 UUID
  69. "level": 0,
  70. "email": "@externalws"
  71. }
  72. ],
  73. "decryption": "none"
  74. },
  75. "streamSettings": {
  76. "network": "ws",
  77. "security": "none",
  78. "wsSettings": {
  79. "acceptProxyProtocol": true, // 提醒:若你用 Nginx/Caddy 等反代 WS,需要删掉这行
  80. "path": "/externalws"
  81. }
  82. }
  83. },
  84. {
  85. "tag": "interconn",
  86. "port": 65510,
  87. "listen": "::1",
  88. "protocol": "vless",
  89. "settings": {
  90. "clients": [
  91. {
  92. "id": "", // 填写你的 UUID
  93. "level": 0,
  94. "email": "@interconn"
  95. }
  96. ],
  97. "decryption": "none"
  98. },
  99. "streamSettings": {
  100. "network": "ws",
  101. "security": "none",
  102. "wsSettings": {
  103. "acceptProxyProtocol": true,
  104. "path": "/interconn"
  105. }
  106. }
  107. }
  108. ],
  109. "outbounds": [
  110. {
  111. "protocol": "freedom",
  112. "tag": "direct"
  113. }
  114. ],
  115. "routing": {
  116. "rules": [
  117. {
  118. "type": "field",
  119. "inboundTag": [
  120. "external",
  121. "externalws"
  122. ],
  123. // 默认将所有来自 external 的流量转发至bridge
  124. // 如果仅转发内网设备流量,则取消注释下面三行
  125. // "ip": [
  126. // "geoip:private"
  127. // ],
  128. "outboundTag": "portal"
  129. },
  130. {
  131. "type": "field",
  132. "inboundTag": [
  133. "interconn"
  134. ],
  135. "domain": [],
  136. "outboundTag": "portal"
  137. },
  138. // 以下路由只会在第一条路由没被匹配到的情况下使用,因此无需额外处理
  139. {
  140. "type": "field",
  141. "port": "0-65535",
  142. "outboundTag": "direct"
  143. }
  144. ]
  145. }
  146. }