超级UDP翻墙 - Hysteria

date
Apr 19, 2022
slug
newservice-udp-hysteria-tunnel
status
Published
summary
新的翻墙服务,UDP超级发包,让比较弱的小鸡复活
tags
service
type
Post
URL

Summary

Server端

选择vps(US-LA | Cloudcone 2C2G60GB@1gbps8T 2021春节可自动备份 ubuntu-cc16bak2)

server端安装hysteria

apt update -y && apt upgrade -y bash <(curl -fsSL https://git.io/hysteria.sh)
notion image

或者用docker

HYSTERIA_SERVER_DOMAIN="your.domain.com"
HYSTERIA_SERVER_DOMAIN_PAIR="[$HYSTERIA_SERVER_DOMAIN]($HYSTERIA_SERVER_DOMAIN)"
HYSTERIA_PWD='Hyster1a'
HYSTERIA_SERVER_PORT=11111  # any port you like for UDP to work

mkdir -p /data/hysteria
cd !$

# "protocol": "wechat-video", // 留空或 "udp", "wechat-video", "faketcp"
cat <<EOF > hysteria.json
{
"listen": "0.0.0.0:$HYSTERIA_SERVER_PORT",
"protocol": "wechat-video",
"acme": {
  "domains": [
    "$HYSTERIA_SERVER_DOMAIN"
  ],
  "email": "hacker@gmail.com",
},
"obfs": "$HYSTERIA_PWD",
"up_mbps": 100,
"down_mbps": 500
}
EOF

docker run -dt --restart always --network=host --name hysteria \
  -v $(pwd)/hysteria.json:/etc/hysteria.json \
  -v $(pwd):/etc/cert \
  tobyxdd/hysteria -c /etc/hysteria.json server


-------------------------------------------------

# 如果只开放udp端口就得自己提供证书了,
cp /root/website/cert/fullchain.cer ./fullchain.cer
cp /root/website/cert/private.key ./private.key
# use existin certificates
cat <<EOF > hysteria.json
{
  "listen": "0.0.0.0:$HYSTERIA_SERVER_PORT",
  "protocol": "wechat-video",
  "cert": "/etc/cert/fullchain.cer",
  "key": "/etc/cert/private.key",
  "obfs": "$HYSTERIA_PWD",
  "up_mbps": 100,
  "down_mbps": 500
}
EOF

# 或者只开放udp端口
docker run -dt --restart always -p $HYSTERIA_SERVER_PORT:$HYSTERIA_SERVER_PORT/udp \
  --name hysteria \
  -v $(pwd)/hysteria.json:/etc/hysteria.json \
  -v $(pwd):/etc/cert \
  tobyxdd/hysteria -c /etc/hysteria.json server

-------------------------------------------------
sleep 5; docker logs -n 50 hysteria
将生成的json当中的http/socks5端口改到自己想要的端

之后client端将在本地这两个端口建立http/socks5代理来利用hysteria 链接

 

client端

Mac客户端

HYSTERIA_SERVER_PORT=11111  # any port you like for UDP to work
HYSTERIA_SERVER_DOMAIN="your.domain.com"
HYSTERIA_PWD="Hyster1a"

mkdir_dir ~/data/hysteria && cd ~/data/hysteria
# 在docker里面必须将127.0.0.1改成0.0.0.0

cat <<EOF > hysteria.json
{
"server": "$HYSTERIA_SERVER_DOMAIN:$HYSTERIA_SERVER_PORT",
"protocol": "wechat-video",
"up_mbps": 100,
"down_mbps": 300,
"http": {
"listen": "0.0.0.0:8888",
"timeout" : 300,
"disable_udp": false
},
"socks5": {
"listen": "0.0.0.0:8889",
"timeout": 300,
"disable_udp": false
},
"alpn": "h3",
"auth_str": "$HYSTERIA_PWD",
"server_name": "$HYSTERIA_SERVER_DOMAIN",
"insecure": false,
"recv_window_conn": 19660800,
"recv_window": 78643200,
"disable_mtu_discovery": true,
"resolver": "8.8.8.8:53",
"retry": 3,
"retry_interval": 3
}
EOF

docker run -dt --restart=always -p 8888:8888 -p 8889:8889 --name hysteria \
  -v $(pwd)/hysteria.json:/etc/hysteria.json \
  tobyxdd/hysteria -c /etc/hysteria.json client

# 本地代理就开在8888(http)和8889(socks5)了


## 最简单版本
cat <<EOF > hysteria.json
{
  "server": "$HYSTERIA_SERVER_DOMAIN:$HYSTERIA_SERVER_PORT",
  "obfs": "$HYSTERIA_PWD",
  "up_mbps": 100,
  "down_mbps": 300,
  "insecure": true,
  "socks5": {
    "listen": "0.0.0.0:8889"
  },
  "http": {
    "listen": "0.0.0.0:8888"
  }
}

EOF
notion image
notion image
notion image

iOS可以用Shadowrocket

notion image
notion image

© Ying Bun 2021 - 2022