You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.1 KiB

  1. // Config file of Xray. This file follows standard JSON format, with comments support.
  2. // Uncomment entries below to satisfy your needs. Also read our manual for more detail at
  3. // https://xtls.github.io/en/config/
  4. {
  5. "log": {
  6. // By default, Xray writes access log to stdout.
  7. // "access": "/path/to/access/log/file",
  8. // By default, Xray write error log to stdout.
  9. // "error": "/path/to/error/log/file",
  10. // Log level, one of "debug", "info", "warning", "error", "none"
  11. "loglevel": "warning"
  12. },
  13. // List of inbound proxy configurations.
  14. "inbounds": [{
  15. // Port to listen on. You may need root access if the value is less than 1024.
  16. "port": 1080,
  17. // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces.
  18. "listen": "127.0.0.1",
  19. // Tag of the inbound proxy. May be used for routing.
  20. "tag": "socks-inbound",
  21. // Protocol name of inbound proxy.
  22. "protocol": "socks",
  23. // Settings of the protocol. Varies based on protocol.
  24. "settings": {
  25. "auth": "noauth",
  26. "udp": false,
  27. "ip": "127.0.0.1"
  28. },
  29. // Enable sniffing on TCP connection.
  30. "sniffing": {
  31. "enabled": true,
  32. // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS.
  33. "destOverride": ["http", "tls"]
  34. }
  35. }],
  36. // List of outbound proxy configurations.
  37. "outbounds": [{
  38. // Protocol name of the outbound proxy.
  39. "protocol": "freedom",
  40. // Settings of the protocol. Varies based on protocol.
  41. "settings": {},
  42. // Tag of the outbound. May be used for routing.
  43. "tag": "direct"
  44. },{
  45. "protocol": "blackhole",
  46. "settings": {},
  47. "tag": "blocked"
  48. }],
  49. // Transport is for global transport settings. If you have multiple transports with same settings
  50. // (say mKCP), you may put it here, instead of in each individual inbound/outbounds.
  51. //"transport": {},
  52. // Routing controls how traffic from inbounds are sent to outbounds.
  53. "routing": {
  54. "domainStrategy": "IPOnDemand",
  55. "rules":[
  56. {
  57. // Blocks access to private IPs. Remove this if you want to access your router.
  58. "type": "field",
  59. "ip": ["geoip:private"],
  60. "outboundTag": "blocked"
  61. },
  62. {
  63. // Blocks major ads.
  64. "type": "field",
  65. "domain": ["geosite:category-ads"],
  66. "outboundTag": "blocked"
  67. }
  68. ]
  69. },
  70. // Dns settings for domain resolution.
  71. "dns": {
  72. // Static hosts, similar to hosts file.
  73. "hosts": {
  74. // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com.
  75. "domain:v2ray.com": "www.vicemc.net",
  76. // The following settings help to eliminate DNS poisoning in mainland China.
  77. // It is safe to comment these out if this is not the case for you.
  78. "domain:github.io": "pages.github.com",
  79. "domain:wikipedia.org": "www.wikimedia.org",
  80. "domain:shadowsocks.org": "electronicsrealm.com"
  81. },
  82. "servers": [
  83. "1.1.1.1",
  84. {
  85. "address": "114.114.114.114",
  86. "port": 53,
  87. // List of domains that use this DNS first.
  88. "domains": [
  89. "geosite:cn"
  90. ]
  91. },
  92. "8.8.8.8",
  93. "localhost"
  94. ]
  95. },
  96. // Policy controls some internal behavior of how Xray handles connections.
  97. // It may be on connection level by user levels in 'levels', or global settings in 'system.'
  98. "policy": {
  99. // Connection policys by user levels
  100. "levels": {
  101. "0": {
  102. "uplinkOnly": 0,
  103. "downlinkOnly": 0
  104. }
  105. },
  106. "system": {
  107. "statsInboundUplink": false,
  108. "statsInboundDownlink": false,
  109. "statsOutboundUplink": false,
  110. "statsOutboundDownlink": false
  111. }
  112. },
  113. // Stats enables internal stats counter.
  114. // This setting can be used together with Policy and Api.
  115. //"stats":{},
  116. // Api enables gRPC APIs for external programs to communicate with Xray instance.
  117. //"api": {
  118. //"tag": "api",
  119. //"services": [
  120. // "HandlerService",
  121. // "LoggerService",
  122. // "StatsService"
  123. //]
  124. //},
  125. // You may add other entries to the configuration, but they will not be recognized by Xray.
  126. "other": {}
  127. }