config_server.json 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {
  2. "log": {
  3. "loglevel": "warning"
  4. },
  5. "routing": {
  6. "domainStrategy": "IPIfNonMatch",
  7. "rules": [
  8. {
  9. "type": "field",
  10. "ip": [
  11. "geoip:cn"
  12. ],
  13. "outboundTag": "block"
  14. }
  15. ]
  16. },
  17. "inbounds": [
  18. {
  19. "listen": "0.0.0.0", // "0.0.0.0" 表示同时监听IPv4和IPv6
  20. "port": 443, // 服务端监听的端口
  21. "protocol": "vless",
  22. "settings": {
  23. "clients": [
  24. {
  25. "id": "", // 用户ID,执行 xray uuid 生成,或 1-30 字节的字符串
  26. "flow": "xtls-rprx-vision"
  27. }
  28. ],
  29. "decryption": "none",
  30. "fallbacks": [
  31. {
  32. "dest": "8001",
  33. "xver": 1
  34. },
  35. {
  36. "alpn": "h2",
  37. "dest": "8002",
  38. "xver": 1
  39. }
  40. ]
  41. },
  42. "streamSettings": {
  43. "network": "tcp",
  44. "security": "tls",
  45. "tlsSettings": {
  46. "rejectUnknownSni": true,
  47. "minVersion": "1.2",
  48. "certificates": [
  49. {
  50. "ocspStapling": 3600,
  51. "certificateFile": "/etc/ssl/private/fullchain.cer", // 证书文件,建议用fullchain(全SSL证书链),若只有网站证书,会出现v2rayN能使用,v2rayNG不能使用的情况,通常不区分扩展名
  52. "keyFile": "/etc/ssl/private/private.key" // 私钥文件
  53. }
  54. ]
  55. }
  56. },
  57. "sniffing": {
  58. "enabled": true,
  59. "destOverride": [
  60. "http",
  61. "tls"
  62. ]
  63. }
  64. }
  65. ],
  66. "outbounds": [
  67. {
  68. "protocol": "freedom",
  69. "tag": "direct"
  70. },
  71. {
  72. "protocol": "blackhole",
  73. "tag": "block"
  74. }
  75. ],
  76. "policy": {
  77. "levels": {
  78. "0": {
  79. "handshake": 2, // 连接建立时的握手时间限制,单位为秒,默认值为 4,建议与默认值不同
  80. "connIdle": 120 // 连接空闲的时间限制,单位为秒,默认值为 300,建议与默认值不同
  81. }
  82. }
  83. }
  84. }