架设自己的V2ray

在Mac的服务器里面跑了V2ray,哈哈哈哈!

为什么要架设V2ray呢?因为已经有了Shadowsocks的服务,但是新一代的类似软甲还没有玩过所以试试。

需要准备什么?

  • 一个服务器,linux最好
    • Ubuntu 20.20
  • 一双勤劳的手
  • 一篇现成的指导文章
    • https://thetowerinfo.com/zh/v2ray-tutorial/

接下来一步一步的执行

首先,更新apt-get和crul,指令中插入&&表示执行完前者,在执行后者

apt-get update -y && apt-get install curl -y

再来,利用Bash来安装V2ray,注意网上流传的指令中使用的url是https://install.direct/go.sh,而这个文件已经被替换,所以执行以下指令(2022.10.22亲测有效,不要用sudo,用sudo -i):

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

接下来,为后续的加密配置UUID(全局用户识别码,相当于加密用户的ID)

cat /proc/sys/kernel/random/uuid

用Vi编辑器创建和编辑V2Ray的配置文件

vi /usr/local/etc/v2ray/config.json

这里是服务器端的配置文件config.json

{
  "inbounds": [
    {
      "port": 1080, // 服务器监听端口
      "protocol": "vmess",    // 主传入协议
      "settings": {
        "clients": [
          {
            "id": "720e422b-5935-424a-8507-64276484af",  // 用户 ID,客户端与服务器必须相同
            "alterId": 0
          }
        ]
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",  // 主传出协议
      "settings": {}
    }
  ]
}

修改完config.json之后要重启服务:

systemctl restart v2ray

记住里面最重要的几个参数:

  • 服务器监听端口1080,可以自己改
  • “id”及UUID:720e422b-5935-424a-8507…… ,其为加密性较强的用户ID,有它就代表了密码
  • 以上就是在小火箭里面要填的重要信息v2ray config client