Skip to content

Parser Options

v2rayroot edited this page Jun 14, 2026 · 1 revision

Parser Options

Complete options object:

{
  "uri": "vless://...",
  "httpPort": 10809,
  "socksPort": 10808,
  "routingMode": "proxy",
  "geositePath": "/opt/v2root/geosite.dat",
  "geositeFile": "/opt/v2root/geosite.dat",
  "geositeDomain": "ir",
  "geositeDNS": "1.1.1.1",
  "dnsConfig": {
    "servers": ["1.1.1.1", "8.8.8.8"],
    "clientIp": "",
    "tag": "",
    "strategy": "UseIP"
  },
  "geositeRules": [
    {"domain": "ads", "action": "block"},
    {"domain": "ir", "action": "direct"}
  ],
  "geoipRules": [
    {"country": "private", "action": "direct"}
  ]
}

Defaults

Option Default
httpPort 10809
socksPort 10808
routingMode proxy in auto-detecting Parse

Validate ports within 1..65535 before calling the library.

Geo Paths

geositeFile is used as a strict asset reference by runtime operations. geositePath is optional. Valid paths may update the process-wide XRAY_LOCATION_ASSET variable.

Compatibility

Unknown JSON fields are ignored by Go decoding. Do not rely on undocumented fields; they may have no effect.

Clone this wiki locally