[GH-ISSUE #534] Unexpected http response: '' when used as http proxy of git #433

Closed
opened 2026-02-27 23:16:53 +03:00 by kerem · 0 comments
Owner

Originally created by @Patrick-Ze on GitHub (May 24, 2023).
Original GitHub issue: https://github.com/snail007/goproxy/issues/534

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
  1. 测试ssh连接情况:OK
ssh -T git@gitlab.domain.com
Welcome to GitLab, @user!
  1. 测试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)

  1. proxy version is : free_13.1
  2. full command is :proxy http -t tcp -p localhost:8899
  3. system is : Windows 10 22H2 (OS Build 19045.2965)
  4. full log is:
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

水平不足以提出

Originally created by @Patrick-Ze on GitHub (May 24, 2023). Original GitHub issue: https://github.com/snail007/goproxy/issues/534 <!--- Provide a general summary of the issue in the Title above --> ## Expected Behavior <!--- Tell us what should happen --> http代理应和git正常配合工作 ## Current Behavior <!--- Tell us what happens instead of the expected behavior --> 启动的http代理能够正常进行网页访问等操作,但是无法作为git的http代理。具体步骤见后文 ## Possible Solution <!--- Not obligatory, but suggest a fix/reason for the bug, --> 水平不足以提出 ## Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug. Include code to reproduce, if relevant --> 具体操作如下: 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 ``` <!--- Provide a general summary of the issue in the Title above --> ## Detailed Description <!--- Provide a detailed description of the change or addition you are proposing --> 请问是否是配置不当或者有什么排查建议? ## Possible Implementation <!--- Not obligatory, but suggest an idea for implementing addition or change --> 水平不足以提出
kerem closed this issue 2026-02-27 23:16:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/goproxy#433
No description provided.