linux:v2ray
This is an old revision of the document!
Table of Contents
v2ray
Install
wget https://install.direct/go.sh sudo bash go.sh
The v2ray command will be located at
/usr/bin/v2ray/v2ray
/usr/bin/v2ray/v2ray -h
Usage of /usr/bin/v2ray/v2ray:
-config string
Config file for V2Ray.
-format string
Format of input file. (default "json")
-test
Test config file only, without launching V2Ray server.
-version
Show current version of V2Ray.
config
/etc/v2ray/config.json
start/stop
``` sudo systemctl start v2ray sudo systemctl restart v2ray ```
Mac Install
- https://github.com/v2ray/homebrew-v2ray
brew tap v2ray/v2ray brew install v2ray-core
Then you can run v2ray, and config file:
/usr/local/etc/v2ray/config.json
run v2ray-core without starting at login.
brew services run v2ray-core
or run v2ray-core and register it to launch at login via:
brew services start v2ray-core
Reference
Config file for server
{
"inbounds": [{
"port": 2710x,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "58ceb1c6-b580-4d2c-bf41-21b6a35ae62x",
"level": 1,
"alterId": 64
}
]
},
"streamSettings": {
"network": "mkcp",
"kcpSettings": {
"uplinkCapacity": 50,
"downlinkCapacity": 100,
"congestion": true,
"header": {
"type": "none"
}
}
}
}
],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
Config file for client
{
"dns": {
"hosts": {
"domain:github.io": "pages.github.com",
"domain:shadowsocks.org": "electronicsrealm.com",
"domain:v2ray.com": "www.vicemc.net",
"domain:wikipedia.org": "www.wikimedia.org"
},
"servers": [
"1.1.1.1",
{
"address": "114.114.114.114",
"domains": [
"geosite:cn"
],
"port": 53
},
"8.8.8.8",
"localhost"
]
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 1080,
"protocol": "socks",
"settings": {
"auth": "noauth",
"ip": "127.0.0.1",
"udp": false
},
"sniffing": {
"destOverride": [
"http",
"tls"
],
"enabled": true
},
"tag": "socks-inbound"
}
],
"log": {
"loglevel": "warning"
},
"other": {},
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "ef.pjq.mx",
"port": 2710x,
"users": [
{
"id": "58ceb1c6-b580-4d2c-bf41-21b6a35ae62x"
}
]
}
]
},
"streamSettings": {
"kcpSettings": {
"congestion": true,
"downlinkCapacity": 100,
"header": {
"type": "none"
},
"uplinkCapacity": 50
},
"network": "mkcp"
}
},
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"policy": {
"levels": {
"0": {
"downlinkOnly": 0,
"uplinkOnly": 0
}
},
"system": {
"statsInboundDownlink": false,
"statsInboundUplink": false
}
},
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"domain": [
"geosite:cn"
],
"outboundTag": "direct",
"type": "field"
},
{
"ip": [
"geoip:cn",
"geoip:private"
],
"outboundTag": "direct",
"type": "field"
},
{
"domain": [
"geosite:category-ads"
],
"outboundTag": "blocked",
"type": "field"
}
]
}
}
/var/www/dokuwiki/wiki/data/attic/linux/v2ray.1563023123.txt.gz · Last modified: 2019/07/13 21:05 by percy
