config.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Config file of V2Ray. 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://www.v2ray.com/
  4. {
  5. "log": {
  6. // By default, V2Ray writes access log to stdout.
  7. // "access": "/path/to/access/log/file",
  8. // By default, V2Ray 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. "enable": 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. // Blacklist all Baidu domains, including all sub domains.
  75. "domain:baidu.com": "127.0.0.1",
  76. // Match v2ray.com to another domain on CloudFlare. This domain will be used
  77. // when querying IPs for v2ray.com.
  78. "domain:v2ray.com": "www.vicemc.net"
  79. },
  80. "servers": [
  81. {
  82. "address": "114.114.114.114",
  83. "port": 53,
  84. // List of domains that use this DNS first.
  85. "domains": [
  86. "geosite:cn"
  87. ]
  88. },
  89. "8.8.8.8",
  90. "1.1.1.1",
  91. "localhost"
  92. ]
  93. },
  94. // Policy controls some internal behavior of how V2Ray handles connections.
  95. // It may be on connection level by user levels in 'levels', or global settings in 'system.'
  96. "policy": {
  97. // Connection policys by user levels
  98. "levels": {
  99. "0": {
  100. "uplinkOnly": 0,
  101. "downlinkOnly": 0
  102. }
  103. },
  104. "system": {
  105. "statsInboundUplink": false,
  106. "statsInboundDownlink": false
  107. }
  108. },
  109. // Stats enables internal stats counter.
  110. // This setting can be used together with Policy and Api.
  111. //"stats":{},
  112. // Api enables gRPC APIs for external programs to communicate with V2Ray instance.
  113. //"api": {
  114. //"tag": "api",
  115. //"services": [
  116. // "HandlerService",
  117. // "LoggerService",
  118. // "StatsService"
  119. //]
  120. //},
  121. // You may add other entries to the configuration, but they will not be recognized by V2Ray.
  122. "other": {}
  123. }