snail007 / goproxy

🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
https://snail007.host900.com/goproxy/manual/zh/
GNU General Public License v3.0
15.86k stars 3.02k forks source link

Unexpected http response: '' when used as http proxy of git #534

Closed Patrick-Ze closed 1 year ago

Patrick-Ze commented 1 year ago

Expected Behavior

http代理应和git正常配合工作

Current Behavior

启动的http代理能够正常进行网页访问等操作,但是无法作为git的http代理。具体步骤见后文

Possible Solution

水平不足以提出

Steps to Reproduce

具体操作如下:

  1. 软件版本 free_13.1 (Windows平台)
  2. 使用如下命令启动http代理 proxy http -t tcp -p localhost:8899
  3. ~/.ssh/config内进行如如下配置
    Host gitlab.domain.com
    ProxyCommand "C:\Program Files\Git\mingw64\bin\connect.exe" -H localhost:8899 %h %p
  4. 测试ssh连接情况:OK
    ssh -T git@gitlab.domain.com
    Welcome to GitLab, @user!
  5. 测试clone/fetch等git相关操作:出现问题
    
    git clone git@gitlab.domain.com:user/gitdemo.git
    Cloning into 'gitdemo'...
    ERROR: Unexpected http response: ''.
    FATAL: failed to begin relaying via HTTP.
    kex_exchange_identification: Connection closed by remote host
    Connection closed by UNKNOWN port 65535
    fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.


## Context (Environment)
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
1. proxy version is : free_13.1
1. full command is :`proxy http -t tcp -p localhost:8899`
1. system is : Windows 10 22H2 (OS Build 19045.2965)
1. full log is: 
```log
2023/05/24 13:53:54.073755 INFO tcp http(s) proxy on 127.0.0.1:8899
2023/05/24 13:54:02.322137 INFO CONNECT:gitlab.domain.com:22
2023/05/24 13:54:02.322137 INFO use parent : false, gitlab.domain.com:22
2023/05/24 13:54:02.343928 INFO conn 127.0.0.1:3804 - 127.0.0.1:8899 <-> 10.8.21.3:3805 - 120.26.124.249:22 connected [gitlab.domain.com:22]
2023/05/24 13:54:03.231281 INFO conn 127.0.0.1:3804 - 127.0.0.1:8899 <-> 10.8.21.3:3805- 120.26.124.249:22 released [gitlab.domain.com:22]
2023/05/24 13:54:08.830796 WARN decoder error , from 127.0.0.1:3809, ERR:http decoder read err: read client http header err: read tcp 127.0.0.1:8899->127.0.0.1:3809: i/o timeout
2023/05/24 13:54:13 Received an interrupt, stopping services...
2023/05/24 13:54:13.297558 WARN accept error , ERR:accept tcp 127.0.0.1:8899: use of closed network connection

Detailed Description

请问是否是配置不当或者有什么排查建议?

Possible Implementation

水平不足以提出