Pass Through the GFW with V2ray

macOS长期不关机貌似时间会变慢, 跟梯子服务器时间差大于90s后就报错扑街, 所以需要更一下时间

sudo sntp -sS time.apple.com

或者干脆重启就正常了

这次功夫墙来的似乎比以往都猛一些, ss 彻底没法用了, 只好再整个梯子, 比如 v2ray

托 docker 的福, 整个部署过程比较轻松写意, 不过因为家里移动宽带不给力的原因, 还得套个 cf 的 cdn 才能 ok

这套即传说中的WebSocket+TLS+Web三件套, 再加 cloudflare CDN 护体, 基本上算是当前最强抗干扰的梯子配置了

用法很简单:

  1. 域名/vps你得有
  2. 给vps装个docker&docker-compose
  3. 下面的三个文件适当改下配置, 如端口/email/uuid等, 复制到同一目录下
  4. 运行docker-compose up -d
  5. 套个 CDN 保护真实 IP 地址(此步可选)

docker-compose.yml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
version: '3'

services:
  v2ray:
    image: v2ray/official
    volumes:
    - ./config.json:/etc/v2ray/config.json
    expose:
    - "44222" # if you need to change this you should change Caddyfile as well

  caddy:
    image: abiosoft/caddy
    volumes:
    - ./Caddyfile:/etc/Caddyfile:ro
    - ./caddyCertificates:/root/.caddy
    environment:
    - ACME_AGREE=true
    ports:
    - "80:80"
    - "443:443"

config.json

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  "inbounds": [
    {
      "listen": "0.0.0.0",
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
          "path": "/ray"
        },
        "security": "none"
      },
      "settings": {
        "clients": [
          {
            "id": "ef50ae52-3f24-4391-a67a-92cf5422f9ff",
            "alterId": 32
          }
        ]
      },
      "protocol": "vmess",
      "port": 44222
    }
  ],
  "outbounds": [
    {
      "tag": "direct",
      "settings": {},
      "protocol": "freedom"
    }
  ]
}

Caddyfile

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
xxx.xxx.xxx {
  gzip
  tls [email protected]
# generated by uuid tools for WebSocket path
  proxy /ray v2ray:44222 {
    websocket
    header_upstream -Origin
  }
    proxy / https://www.bing.com {
    transparent
  }
  # write log to stdout for docker
  log stdout
  errors stdout
}
加载评论