V2Ray

From ArchWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

V2Ray is the core tool of Project V, which is mainly responsible for the realization of network protocols and functions, and communicates with other Project V.

Installation

Install the v2ray package.

Configuration

V2Ray supports multi-file configuration.

A simple structure is:

/etc/v2ray/
.
├── 00_log.json
├── 01_api.json
├── 02_dns.json
├── 03_routing.json
├── 04_policy.json
├── 05_inbounds.json
├── 06_outbounds.json
├── 07_transport.json
├── 08_stats.json
└── 09_reverse.json

0 directories, 10 files

Usage

Start/enable v2ray.service.

To use multi-file configuration, edit /etc/systemd/system/v2ray.service and add the following:

/etc/systemd/system/v2ray.service
[Unit]
Description=V2Ray Service
After=network.target nss-lookup.target

[Service]
User=nobody
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/v2ray -confdir /etc/v2ray/

[Install]
WantedBy=multi-user.target

Configuration method

V2Ray has a variety of configuration methods, currently the most effective is WebSocket + TLS.

Tip: It is a more reasonable and manageable way to configure TLS by Nginx.

See