Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装vless协议的v2ray #26

Open
dalaolala opened this issue May 27, 2021 · 4 comments
Open

安装vless协议的v2ray #26

dalaolala opened this issue May 27, 2021 · 4 comments

Comments

@dalaolala
Copy link
Owner

dalaolala commented May 27, 2021

VMESS 相信大家都不陌生了,他是 V2RAY 的传输协议。
但是在 5 月 V2RAY 爆出新闻之后,很多大神们都在弄一个新的协议,最具代表的就是 VLESS 协议。

官方安装参考这里
https://github.com/v2fly/fhs-install-v2ray

安装curl

yum makecache
yum install curl

下载脚本执行

curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
bash install-release.sh
bash install-dat-release.sh

国内服务器执行

curl -O https://raw.githubusercontent.com/dalaolala/blog/master/vvv/a.sh
curl -O https://raw.githubusercontent.com/dalaolala/blog/master/vvv/a.sh

获取一个新的uuid
https://1024tools.com/uuid 复制其中一行 uuid

进入 /usr/local/etc/v2ray/ 目录,编辑 config.json 文件 将里面全部代码改为:

{
  "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
  "inbounds": [
    {
    "port":你的端口,
      "listen": "127.0.0.1",
      "tag": "VLESS-in",
      "protocol": "VLESS",
      "settings": {
        "clients": [
          {
          "id":"你的 UUID",
            "alterId": 0
          }
        ],
            "decryption": "none"
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
          "path":"/cs" 
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": { },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": { },
      "tag": "blocked"
    }
  ],
  "dns": {
    "servers": [
      "https+local://1.1.1.1/dns-query",
          "1.1.1.1",
          "1.0.0.1",
          "8.8.8.8",
          "8.8.4.4",
          "localhost"
    ]
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "VLESS-in"
        ],
        "outboundTag": "direct"
      }
    ]
  }
}
@dalaolala
Copy link
Owner Author

dalaolala commented Aug 11, 2021

如果使用v2ray协议,则使用如下的配置

{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 9000, 
    "listen": "127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "eb950add-608e-409d-937f-e797324387098b", 
          "level": 1,
          "alterId": 0 
        }
      ]
    },
   "streamSettings":{
      "network": "ws",
      "wsSettings": {
           "path": "/api"
      }
   }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "field",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "outboundTag": "blocked"
        }
      ]
    }
  }
}

参考来自
https://www.rootfw.com/posts/d2834d54.html

@dalaolala
Copy link
Owner Author

dalaolala commented Jan 12, 2022

环境变量名不宜为 v2ray.vmess.aead.forcedv2ray_vmess_aead_forced解决

alterId都设置0就好了

参考

Jrohy/multi-v2ray#561

一键脚本参考

https://github.com/dalaolala/VMess-fAEAD-disable

@dalaolala
Copy link
Owner Author

nginx反向代理配置

    location /api { 
    proxy_redirect off;
    proxy_pass http://127.0.0.1:9000; 
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
   }

@dalaolala
Copy link
Owner Author

dalaolala commented May 31, 2023

TCP协议可以使用下面的配置

配置来自chatpgt =-=

{
  "inbounds": [
    {
      "port": 11112, //监听端口
      "protocol": "vmess", //协议类型
      "settings": {
        "clients": [
          {
            "id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9", //客户端UUID
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "tcp", //底层传输协议
        "tcpSettings": {
          "header": {
            "type": "http", //TCP头部类型,可选 http 或 srtp
            "request": {
              "version": "1.1",
              "method": "GET",
              "path": ["/go"],
              "headers": {
                "Host": ["download.windowsupdate.com"],
                "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"]
              }
            },
            "response": {
              "version": "1.1",
              "status": "200",
              "reason": "OK",
              "headers": {
                "Content-Type": ["application/octet-stream"],
                "Transfer-Encoding": ["chunked"],
                "Connection": ["keep-alive"],
                "Pragma": "no-cache"
              }
            }
          }
        }
      },
      "sniffing": {
        "enabled": true, //是否开启流量探测
        "destOverride": ["http", "tls"] //探测目的地
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}
客户端的配置参考如下

image

Repository owner deleted a comment from Soumya6Tiwari Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant