V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
novolunt
V2EX  ›  Go 编程语言

好用的 golang 前置 proxy 推荐

  •  
  •   novolunt · 2022-10-14 17:01:35 +08:00 · 3023 次点击
    这是一个创建于 564 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • 需求: 找一个支持 go-ss2 前置 proxy ,http_proxy 和 proxychains 默认不支持 golang

    正常响应

    $ curl -x 127.0.0.1:8888 ip.sb
    91.x.x.x
    

    错误 DEBUG

    • linux 环境:
    Linux xxxx 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    
    • 程序一 graftcp
    graftcp/local/mgraftcp --enable-debug-log --http_proxy=127.0.0.1:8888  curl ip.sb
    [2022-10-14 16:50:37] [INFO] graftcp-local start listening :0...  << 卡住不动
    
    • 程序二 cproxy
    sudo ./cproxy --port 8888  -- curl ip.sb
    Bad Request
    
    • 程序三 proxychains-ng
    $ egrep -v '^\s*$|^\s*#'  /etc/proxychains.conf
    strict_chain
    proxy_dns
    remote_dns_subnet 224
    tcp_read_time_out 15000
    tcp_connect_time_out 8000
    localnet 127.0.0.0/255.0.0.0
    localnet 10.0.0.0/255.0.0.0
    [ProxyList]
    http    127.0.0.1 8888
    

    运行结果

    $ proxychains4 curl ip.sb
    [proxychains] config file found: /etc/proxychains.conf
    [proxychains] preloading /usr/lib64/proxychains-ng/libproxychains4.so
    [proxychains] DLL init: proxychains-ng 4.16
    [proxychains] Strict chain  ...  127.0.0.1:8888  ...  ip.sb:80 <--denied
    curl: (7) Failed to connect to 224.0.0.1: Connection refused
    
    17 条回复    2022-10-16 21:47:39 +08:00
    CEBBCAT
        1
    CEBBCAT  
       2022-10-14 18:06:37 +08:00
    谁看懂了的可不可以帮我解释一下?谢谢🙏
    1423
        2
    1423  
       2022-10-14 18:19:23 +08:00 via iPhone
    surge
    但你上面用法都不对啊。。
    jiangwei2222
        3
    jiangwei2222  
       2022-10-14 19:13:28 +08:00 via Android
    @CEBBCAT 哈哈哈,我也没看懂
    dic
        4
    dic  
       2022-10-14 21:14:24 +08:00
    go env -w GOPROXY=https://goproxy.cn,direct

    golang 的代理这么设置不就可以了吗?
    neighbads
        5
    neighbads  
       2022-10-15 00:45:28 +08:00 via Android
    go-graft ?
    kkbblzq
        6
    kkbblzq  
       2022-10-15 01:14:38 +08:00
    你是要搞透明代理吗。。。你确定你 ss2 是 http ?我没记错 ss client 不是 socks 吗。。那你这配的就不对吧。。
    DefoliationM
        7
    DefoliationM  
       2022-10-15 01:36:34 +08:00 via Android
    http 支持好吧
    flynaj
        8
    flynaj  
       2022-10-15 01:39:47 +08:00 via Android
    gost 支持比较全面
    novolunt
        9
    novolunt  
    OP
       2022-10-15 19:06:54 +08:00
    我的 ss 是美国的,能直接访问,速度也快,又有一个日本的 http proxy ,但不能只能访问。我想服务器端走 eth0 --> jp http --> ss proxy ,用的 go 版本的 ss ,测试了几个前置 proxy 客户端都不能用,测试用的是 curl 测试更方便。
    @CEBBCAT
    @1423
    @jiangwei2222
    @dic
    mzz2017
        10
    mzz2017  
       2022-10-15 19:38:33 +08:00
    1423
        11
    1423  
       2022-10-15 19:58:47 +08:00
    @novolunt 很显然,这些工具都是 OK 的。
    如果用起来不对路,那是你没有用对
    novolunt
        12
    novolunt  
    OP
       2022-10-15 20:11:36 +08:00
    @1423 测试过才有发言权, replit.com 的账号可以提供下,邀请测试。
    1423
        13
    1423  
       2022-10-15 22:25:45 +08:00
    @novolunt w1423
    novolunt
        14
    novolunt  
    OP
       2022-10-16 20:23:44 +08:00
    @1423 已邀请,点提醒
    1423
        15
    1423  
       2022-10-16 21:07:38 +08:00
    @novolunt

    话说你这也算提供了免费的 hola 代理出来,谢了。

    不过我手里也有很多。。
    1423
        16
    1423  
       2022-10-16 21:13:25 +08:00
    @novolunt

    ```
    PROXY : 2022/10/16 13:11:22 handler.go:49: ERROR Can't satisfy CONNECT request: bad response from upstream proxy server: 403 Bad Port
    ```
    看来 hola 的免费代理不给转发 80 端口。
    1423
        17
    1423  
       2022-10-16 21:47:39 +08:00
    @novolunt 我也 share 下吧,摸索了下 hola 。
    1. 国别域名可以遍历出所有服务器,比如 jp.vpn.hola.org (单个 DNS 不全,需要自己搜集
    2. 服务器 sni 只有 *.hola.org (用 jp.vpn 的话需要自己信任或者 skip sni
    3. 端口同样支持 http proxy (不在意安全可以获得更少 rtt
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1232 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:33 · PVG 01:33 · LAX 10:33 · JFK 13:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.