# Warp 转 SOCKS5

## 申请 Warp 账户

- 下载 wgcf

- wget https://github.com/ViRb3/wgcf/releases/download/v2.2.15/wgcf\_2.2.15\_linux\_amd64 -O wgcf && chmod +x wgcf

- ./wgcf register

- ./wgcf generate 拷贝内容如下：

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    [Interface]
    PrivateKey = 我的私钥
    Address = 172.16.0.2/32
    Address = 2606:4700:110:8949:fed8:2642:a640:c8e1/128
    DNS = 1.1.1.1
    MTU = 1280
    [Peer]
    PublicKey = Warp公钥
    AllowedIPs = 0.0.0.0/0
    AllowedIPs = ::/0
    Endpoint = engage.cloudflareclient.com:2408

## Warp 转 SOCKS5

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    version: '3.3'
    services:
        socks5:
            container_name: socks5
            restart: always
            volumes:
                - './config.json:/etc/xray/config.json'
            image: teddysun/xray:1.7.2

    networks:
      default:
        external: true
        name: warp

    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95

    {
      "dns": {
        "hosts": {
          "domain:googleapis.cn": "googleapis.com"
        },
        "servers": [
          "1.1.1.1",
      "8.8.8.8",
      "localhost"
        ]
      },
      "inbounds": [
        {
          "port": 20808,
          "protocol": "socks",
          "settings": {
            "auth": "password",
    "accounts": [
    {
      "user": "limour",
      "pass": "my-password"
    }
    ],
            "udp": true,
            "userLevel": 8
          },
          "sniffing": {
            "destOverride": [
              "http",
              "tls"
            ],
            "enabled": true
          },
          "tag": "socks"
        }
      ],
      "log": {
        "loglevel": "warning"
      },
      "outbounds": [
    {
      "protocol": "wireguard",
      "settings": {
    "secretKey": "我的私钥",
    "address": ["172.16.0.2/32", "2606:4700:110:8949:fed8:2642:a640:c8e1/128"],
    "peers": [
      {
    "publicKey": "Warp公钥",
    "endpoint": "engage.cloudflareclient.com:2408"
      }
    ]
      },
      "tag": "wireguard-1"
    },
        {
          "protocol": "freedom",
          "settings": {},
          "tag": "direct"
        }
      ],
      "routing": {
        "domainMatcher": "mph",
        "domainStrategy": "IPIfNonMatch",
    "rules": [
    {
    "type": "field",
    "domain": [
    "geosite:cn"
    ],
    "outboundTag": "wireguard-1"
    },
    {
    "type": "field",
    "ip": [
    "geoip:cn"
    ],
    "outboundTag": "wireguard-1"
    },
    {
    "ip": [
      "geoip:private"
    ],
    "outboundTag": "direct",
    "type": "field"
    },
    {
    "domain": [
      "domain:googleapis.cn"
    ],
    "outboundTag": "direct",
    "type": "field"
            }
    ]
      }
    }

- sudo docker network create warp

- mkdir -p ~/app/socks5 && cd ~/app/socks5 && nano docker-compose.yml

- nano ./config.json

- sudo docker-compose up -d && sudo docker-compose logs

- # sudo docker-compose down

## SOCKS5 转 hysteria

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    version: '3.9'
    services:
      hysteria:
        image: tobyxdd/hysteria
        container_name: hysteria
        restart: always
        ports:
          - '80:80'
          - '3234:3234/udp'
          - '443:443'
        volumes:
          - ./hysteria.json:/etc/hysteria.json
        command: ["server", "--config", "/etc/hysteria.json"]

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

    {
      "listen": ":3234",
      "protocol": "udp",
      "acme": {
        "domains": [
          "www.j11.fun"
        ],
        "email": "www@j11.fun"
      },
      "obfs": "8ZuA2Zpqhuk8yakXvMjDqEXBwY",
      "up_mbps": 100,
      "down_mbps": 100,
      "resolver": "udp://1.1.1.1:53",
      "resolve_preference": "46",
      "socks5_outbound": {
        "server": "socks5:20808",
        "user": "limour",
        "password": "my-password"
      }
    }

- mkdir -p ~/app/hysteria && cd ~/app/hysteria

- wget https://raw.githubusercontent.com/apernet/hysteria/master/docker-compose.yaml

- nano docker-compose.yml

- nano ./hysteria.json

- sudo docker-compose up -d && sudo docker-compose logs

- sudo docker exec -it hysteria apk add curl

- sudo docker exec -it hysteria curl –socks5 socks5:20808 –proxy-user limour:my-password http://myip.ipip.net

- sudo docker exec -it hysteria curl –socks5 socks5:20808 –proxy-user limour:my-password https://api.ipify.org/?format=json

- sudo docker exec -it hysteria ping socks5

- 将json文件里的socks5:20808中的socks5改为socks5对应的ip(如172.18.0.2)

- sudo docker-compose restart

## hysteria 端口跳跃

- iptables -t nat -L

- 模仿 docker 的操作，将 10000:60000 都映射到 hysteria 容器的3234端口

- iptables -t nat -A DOCKER -p udp –dport 10000:60000 -j DNAT –to-destination 172.18.0.2:3234

## hysteria 客户端

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    version: '3.9'
    services:
      hysteria:
        image: tobyxdd/hysteria
        container_name: hysteria
        restart: always
        ports:
          - '1580:1580'
          - '1580:1580/udp'
          - '8580:8580'
        volumes:
          - ./hysteria.json:/etc/hysteria.json
        command: ["--config", "/etc/hysteria.json"]

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    {
      "server": "example.com:10000-60000",
      "obfs": "8ZuA2Zpqhuk8yakXvMjDqEXBwY",
      "up_mbps": 10,
      "down_mbps": 50,
      "socks5": {
        "listen": "0.0.0.0:1580"
      },
      "http": {
        "listen": "0.0.0.0:8580"
      }
    }

- mkdir -p ~/app/hysteria && cd ~/app/hysteria && nano docker-compose.yml

- nano ./hysteria.json

- sudo docker-compose up -d && sudo docker-compose logs

- # sudo docker-compose down

- curl –socks5 127.0.0.1:1580 http://myip.ipip.net

- # sudo docker-compose restart && sudo docker-compose logs

- curl –socks5 127.0.0.1:1580 https://api.ipify.org/?format=json

uncategorized
Warp 转 SOCKS5
https://occdn.limour.top/2545.html
Author
Limour
Posted on
January 30, 2023
Licensed under
Nginx Proxy Manager进阶：反代grpc Previous
【从零开始配置VPS】09：替换网站页面中的关键词 Next

#### Search

Keyword