gost3.0反向代理

93 views
Skip to first unread message

agusta gu

unread,
Mar 25, 2025, 8:01:35 AMMar 25
to go-gost
我想用gost弄一个反向代理,将 curl http://ipinfo.io 的请求通过指定的代理发出。当我指定无用户名密码的代理时正常,指定到有用户名密码的代理时就发生异常。我在使用正向代理时,需要用户名密码的172.234.141.65这个也能发出去。就使用反向代理时发不出去。

gost.yml内容如下:
services:
- name: http-proxy
  addr: :8080
  handler:
    type: tcp
    metadata:
      sniffing: true
  listener:
    type: tcp
  forwarder:
    nodes:
    - name: example-com
      addr: 172.234.141.65:7778
      matcher:
        rule: Header(`country`, `USS`)
      auth:
        username: B_46712_US___5_f8beec89
        password: Nova2025
    - name: target-US
      addr: 49.51.196.133:8926
      matcher:
        rule: Header(`country`, `US`)
    - name: target-JP
      addr: 43.156.32.234:10918
      matcher:
        rule: Header(`country`, `JP`)
    - name: target-TW
      addr: 43.128.89.121:11442
      matcher:
        rule: Header(`country`, `TW`)

执行命令如下:gost -D -C gost.yml
另一个终端:curl -x localhost:8080 -m5 -s "http://ipinfo.io" -H "country: USS"

报错如下:
{"caller":"service\\service.go:248","handler":"tcp","kind":"service","level":"error","listener":"tcp","msg":"unauthorized","service":"http-proxy","sid":"cvh9i3skemoj955p265g","time":"2025-03-25T19:52:47.773+08:00"}

agusta gu

unread,
Mar 25, 2025, 8:17:47 AMMar 25
to go-gost
在 auth 上一级加 http 或者 connector 也不行。

services:
- name: http-proxy
  addr: :8080
  handler:
    type: tcp
    metadata:
      sniffing: true
  listener:
    type: tcp
  forwarder:
    nodes:
    - name: example-com
      addr: 172.234.141.65:7778
      matcher:
        rule: Header(`country`, `USS`)
      http:

        auth:
          username: B_46712_US___5_f8beec89
          password: Nova2025
Reply all
Reply to author
Forward
0 new messages