V2RAY性能调优

最近在github上发现了个牛逼到不行的v2ray调优的帖子,配置好后速度和延迟翻了整整6倍,记录一下

搬瓦工CN2机房下载速度大概在10MB/s左右,youtube 4k不卡

配置

V2RAY

{
  "inbounds": [
    {
      "port": 12345,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": false,
        "userLevel": 999
      },
      "streamSettings": {
        "network":"ws",
        "wsSettings": {
          "path":"/afpizxcnjqnv99f3234jz7624inx78123n"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

NGINX

这里只是把我的配置粘过来了,证书和listen 443 可以先不用设置,后期用certbot自动挂即可

server {
    server_name  test.domin.com;
    location / {
  root	/www/webpath;
        index  index.html index.htm;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location /afpizxcnjqnv99f3234jz7624inx78123n{
      proxy_redirect off;
      proxy_pass http://127.0.0.1:12345;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}      
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/test.domin.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/test.domin.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
    if ($host = test.domin.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name  test.domin.com;
    listen 80;
    return 404; # managed by Certbot

}

客户端

{
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
    	"tag": "socks",
      "listen": "0.0.0.0",
      "port": 10808,
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": ["http", "tls"]
      },
      "settings": {
        "auth": "noauth",
        "userLevel": 10,
        "udp": true
      }
    },
    {
      "tag": "http",
      "port": 10809,
      "listen": "127.0.0.1",
      "protocol": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "udp": false,
        "allowTransparent": false
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "socks",
      "settings": {
        "servers": [
          {
            "address": "test.domin.com",
            "level": 10,
            "port": 443
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "wsSettings": {
          "path": "/afpizxcnjqnv99f3234jz7624inx78123n"
        }
      },
      "mux": {
        "enabled": true,
        "concurrency": 8
      }
    }
  ]
}

把客户端的配置保存为socks.json,使用v2rayN中的–添加自定义配置服务器  加载配置文件即可使用

github原始讨论帖

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注