本帖最後由 tomleehk 於 2019-12-27 12:20 編輯
v2ray.json- {
- "inbounds": [
- {
- "port": 1080,
- "listen": "0.0.0.0",
- "protocol": "socks",
- "sniffing": {
- "enabled": true,
- "destOverride": ["http", "tls"]
- },
- "settings": {
- "auth": "noauth",
- "udp": true
- }
- },
- {
- "port": 8080,
- "listen": "0.0.0.0",
- "protocol": "http",
- "sniffing": {
- "enabled": true,
- "destOverride": ["http", "tls"]
- },
- "settings": {
- "timeout": 300
- }
- },
- {
- "port": 12345,
- "protocol": "dokodemo-door",
- "sniffing": {
- "enabled": true,
- "destOverride": ["http", "tls"]
- },
- "settings": {
- "network": "tcp,udp",
- "timeout": 0,
- "followRedirect": true
- }
- }
- ],
- "outbounds": [
- {
- "protocol": "vmess",
- "settings": {
- "vnext": [
- {
- "address": "server ip",
- "port": 443,
- "users": [
- {
- "id": "779e81cb-79b6-3377-b2b5-ce402c21b8f5",
- "security": "aes-128-gcm",
- "alterId": 64
- }
- ]
- }
- ]
- },
- "streamSettings": {
- "network": "ws",
- "security": "tls",
- "tlsSettings": {"allowInsecure": true,"serverName": "server url"},
- "wsSettings": {
- "path": "/vpath"
- }
- }
- }
- ]
- }
複製代碼 v2ray 啟動 script- #!/bin/sh /etc/rc.common
- # "new" style init script
- # Look at /lib/functions/service.sh on a running system for explanations of what other SERVICE_
- # options you can use, and when you might want them.
- START=80
- STOP=20
- APP=v2ray
- SERVICE_WRITE_PID=1
- SERVICE_DAEMONIZE=1
- PREFIX=/usr/bin
- start() {
- service_start $PREFIX/v2ray -config $PREFIX/v2ray.json
- $PREFIX/client_proxy.sh start
- }
- stop() {
- $PREFIX/client_proxy.sh stop
- service_stop $PREFIX/v2ray
- }
複製代碼 成功啟動後可以用
ps | grep "v2ray"
curl -Is -x 127.0.0.1:8080 https://www.google.com
curl -x socks5://127.0.0.1:1080 www.google.com
睇吓有無正確嘅response
留意port 1080及port 8080呢2段嘅config只喺方便用curl測試connection,
本身運作上並非必要 |