本帖最后由 zdszf 于 2019-12-8 16:38 编辑
花了一上午来看v2ray的说明,一点点的写配置,终于懂了个大概。尝试了动态端口+mkcp和ws+tls+web+cdn。ws套CDN速度和以前gost -L=ss+ohttp速度齐平,KCP速度和gost开kcp也没明显区别。
目前觉得最让我喜欢的是路由功能,比如从服务端屏蔽网站,转发特殊访问(比如把看NF的请求转发到原生VPS上)。
还有啥骚操作,大佬们指点下吧
美国VPS综合讨论: v2ray官方一键脚本支持小内存VPS安装的alpine吗? 试试先.
配置例子:
- # Usage:
- # v2ray.server
- # install
- bash <(curl -L -s https://install.direct/go.sh)
- ############# server config #############
- vi /etc/v2ray/config.json
- {
- "sniffing": {"enabled": true,"destOverride": ["http","tls"]},
-
- "inbounds":
- [
- {
- "port": 1289,
- "protocol": "vmess",
- "settings": {"clients": [{ "id": "UUID","alterId": 32}]},
- "detour": {"to": "dynamicPort"},
- "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 25,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
- },
-
- {
- "port": "10000-20000",
- "protocol": "vmess",
- "tag": "dynamicPort",
- "settings": {"default": {"alterId": 32}},
- "allocate": {"strategy": "random","concurrency": 3,"refresh": 5},
- "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 25,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
- }
- ],
-
- "outbounds":
- [
- {
- "protocol": "freedom",
- "settings": {}
- },
-
- {
- "protocol": "blackhole",
- "settings": {},
- "tag": "block"
- }
- ],
-
- "routing":
- {
- "domainStrategy": "AsIs",
- "rules":
- [
- {"type": "field","outboundTag": "block","protocol": ["bittorrent"]},
- {"type": "field","outboundTag": "block","ip": ["geoip:private"]},
- {"type": "field","outboundTag": "block","domain": ["geosite:qihoo360"]}
- ]
- }
- }
- ############# server config #############
- # active
- service v2ray restart
- ############# client config #############
- {
- "inbounds":
- [
- {
- "port": 1087,
- "listen": "127.0.0.1",
- "protocol": "socks",
- "settings": {"udp": true}
- },
-
- {
- "port": 1089,
- "listen": "0.0.0.0",
- "protocol": "shadowsocks",
- "settings": {"method": "chacha20","password": "123456","network": "tcp,udp"}
- }
- ],
-
- "outbounds":
- [
- {
- "protocol": "vmess",
- "settings": {
- "vnext":
- [
- {
- "address": "127.178.127.228",
- //"address": "277.185.613.314",
- "port": 1289,
- "users": [{"id": "UUID","alterId": 2}]
- }
- ]
- },
-
- "mux": {"enabled": true,"concurrency": 128},
-
- "streamSettings": {"network": "mkcp","kcpSettings": {"uplinkCapacity": 5,"downlinkCapacity": 100,"congestion": true,"header": {"type": "utp"}}}
- },
-
- {
- "protocol": "freedom",
- "tag": "direct",
- "settings": {}
- }
- ],
-
- "dns": {
- "servers":
- [
- "8.8.8.8",
- {"address": "223.5.5.5","port": 53,"domains": ["geosite:cn"],"expectIPs": ["geoip:cn"]},
- "8.8.4.4",
- "localhost"
- ]
- },
-
- "routing":
- {
- "domainStrategy": "IPIfNonMatch",
- "rules":
- [
- {"type": "field","outboundTag": "direct","domain": ["geosite:cn"]},
- {"type": "field","outboundTag": "direct","ip": ["geoip:cn","geoip:private"]}
- ]
- }
- }
- ############# client config #############
- 自己按需修改
复制代码 |