Quick Start

You need to configure V2Ray after installing it. Here is a quick configuration for a demo run. Please see configuration overview for more advanced setup.

Client

On your PC (or mobile), run V2Ray with the following configuration.

{
  "inbounds": [{
    "port": 1080,  // Port of socks5 proxy. Point your browser to use this port.
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "udp": true
    }
  }],
  "outbounds": [{
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "server", // Address of your V2Ray server. May be IP or domain address.
        "port": 10086,  // Port of your V2Ray server.
        "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
      }]
    }
  },{
    "protocol": "freedom",
    "tag": "direct",
    "settings": {}
  }],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [{
      "type": "field",
      "ip": ["geoip:private"],
      "outboundTag": "direct"
    }]
  }
}

Please modify the IP address of your V2Ray server as mentioned above. After that, the V2Ray process on your PC will proxy all traffic to V2Ray server except intranet traffic.

Server

You need another computer to run V2Ray as a server. Usually this computer is located outside firewall. Here is a sample configuration.

{
  "inbounds": [{
    "port": 10086, // Port of the server. Must be the same as above.
    "protocol": "vmess",
    "settings": {
      "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}

Please make sure the id field is the same between client and server.

Running

  • On Windows and macOS, configuration file is located in the same directory as V2Ray binary. You may run v2ray or v2ray.exe without additional parameters.
  • On Linux, configuration file is usually located at /etc/v2ray/config.json. Run v2ray --config=/etc/v2ray/config.json in foreground or use other tools such as systemd to run V2Ray as background process.

See Overview for more detail of the configuration.