[GH-ISSUE #519] 我在使用贵项目做http代理时,中间使用tcp协议可以通,但是使用kcp协议就失败了,提示decoder err,我想解决这个问题。 #421

Open
opened 2026-02-27 23:16:51 +03:00 by kerem · 2 comments
Owner

Originally created by @jzbg on GitHub (Jan 10, 2023).
Original GitHub issue: https://github.com/snail007/goproxy/issues/519

Expected Behavior

我在使用贵项目做http代理时,中间使用tcp协议可以通,但是使用kcp协议就失败了,提示decoder err,我想解决这个问题。

Current Behavior

一级代理日志如下,提示 released [192.168.1.32:80]
C:\Users\Administrator\Desktop\proxy-windows-amd64>proxy http -t kcp -p "0.0.0.0
:38080" --kcp-key mypassword
2023/01/10 09:58:14.251976 INFO kcp http(s) proxy on 0.0.0.0:38080
2023/01/10 10:00:20.676777 INFO GET:http://192.168.1.32/?user/login.html
2023/01/10 10:00:20.676777 INFO use parent : false, 192.168.1.32:80
2023/01/10 10:00:20.677777 INFO conn 192.168.1.31:65084 - 0.0.0.0:38080 <-> 192.
168.1.32:53461 - 192.168.1.32:80 connected [192.168.1.32:80]
2023/01/10 10:00:20.697777 INFO conn 192.168.1.31:65084 - 0.0.0.0:38080 <-> 192.
168.1.32:53461- 192.168.1.32:80 released [192.168.1.32:80]
2023/01/10 10:00:23.409177 INFO CONNECT:sug.so.360.cn:443
2023/01/10 10:00:23.409177 INFO use parent : false, sug.so.360.cn:443
2023/01/10 10:00:25.798377 INFO CONNECT:sug.so.360.cn:443
2023/01/10 10:00:25.798377 INFO use parent : false, sug.so.360.cn:443
2023/01/10 10:00:26.161377 INFO GET:http://192.168.1.112/
2023/01/10 10:00:26.161377 INFO use parent : false, 192.168.1.112:80
2023/01/10 10:00:26.163377 INFO conn 192.168.1.31:65087 - 0.0.0.0:38080 <-> 192.
168.1.32:53462 - 192.168.1.112:80 connected [192.168.1.112:80]
2023/01/10 10:00:26.189377 INFO conn 192.168.1.31:65087 - 0.0.0.0:38080 <-> 192.
168.1.32:53462- 192.168.1.112:80 released [192.168.1.112:80]

二级代理日志如下,提示http decoder read err:
C:\Users\Administrator\Desktop\proxy-windows-amd64>proxy http -t tcp -p "0.0.0.0
:8083" -T kcp -P "192.168.1.32:38080" --kcp-key mypassword
2022/01/10 09:59:30.986955 INFO use kcp parent [192.168.1.32:38080] [ ROUNDROBIN
]
2022/01/10 09:59:31.009555 INFO tcp http(s) proxy on [::]:8083
2022/01/10 10:00:22.503755 INFO GET:http://192.168.1.32/?user/login.html
2022/01/10 10:00:22.503755 INFO use parent : true, 192.168.1.32:80
2022/01/10 10:00:22.503755 INFO conn 192.168.1.111:59477 - 192.168.1.31:8083 <->
0.0.0.0:65084 - 192.168.1.32:38080 connected [192.168.1.32:80]
2022/01/10 10:00:23.503955 WARN decoder error , from 192.168.1.111:59478, ERR:ht
tp decoder read err: http decoder read err: read tcp 192.168.1.31:8083->192.168.
1.111:59478: i/o timeout
2022/01/10 10:00:25.285955 INFO CONNECT:sug.so.360.cn:443
2022/01/10 10:00:25.285955 INFO use parent : true, sug.so.360.cn:443
2022/01/10 10:00:25.286955 INFO conn 192.168.1.111:59481 - 192.168.1.31:8083 <->
0.0.0.0:65085 - 192.168.1.32:38080 connected [sug.so.360.cn:443]
2022/01/10 10:00:27.668955 INFO CONNECT:sug.so.360.cn:443
2022/01/10 10:00:27.669955 INFO use parent : true, sug.so.360.cn:443
2022/01/10 10:00:27.669955 INFO conn 192.168.1.111:59484 - 192.168.1.31:8083 <->
0.0.0.0:65086 - 192.168.1.32:38080 connected [sug.so.360.cn:443]
2022/01/10 10:00:28.001955 INFO GET:http://192.168.1.112/
2022/01/10 10:00:28.001955 INFO use parent : true, 192.168.1.112:80
2022/01/10 10:00:28.002955 INFO conn 192.168.1.111:59485 - 192.168.1.31:8083 <->
0.0.0.0:65087 - 192.168.1.32:38080 connected [192.168.1.112:80]
2022/01/10 10:00:28.995955 WARN decoder error , from 192.168.1.111:59486, ERR:ht
tp decoder read err: http decoder read err: read tcp 192.168.1.31:8083->192.168.
1.111:59486: i/o timeout

Possible Solution

Steps to Reproduce

首先启动一级代理
然后启动二级代理
浏览器设置代理
发现问题,代理失败

Context (Environment)

  1. proxy version is : 12.3
  2. full command is :proxy http -t tcp -p "0.0.0.0:8083" -T kcp -P "192.168.1.32:38080" --kcp-key mypassword
  3. proxy http -t kcp -p "0.0.0.0:38080" --kcp-key mypassword
  4. system is :win7
  5. full log is: 上边已提交
  6. 浏览器用的360极速浏览器21.0.1180

Detailed Description

通过kcp协议代理http,代理失败,提示http decoder err

Possible Implementation

无法推测原因

Originally created by @jzbg on GitHub (Jan 10, 2023). Original GitHub issue: https://github.com/snail007/goproxy/issues/519 <!--- Provide a general summary of the issue in the Title above --> ## Expected Behavior <!--- Tell us what should happen --> 我在使用贵项目做http代理时,中间使用tcp协议可以通,但是使用kcp协议就失败了,提示decoder err,我想解决这个问题。 ## Current Behavior <!--- Tell us what happens instead of the expected behavior --> 一级代理日志如下,提示 released [192.168.1.32:80] C:\Users\Administrator\Desktop\proxy-windows-amd64>proxy http -t kcp -p "0.0.0.0 :38080" --kcp-key mypassword 2023/01/10 09:58:14.251976 INFO kcp http(s) proxy on 0.0.0.0:38080 2023/01/10 10:00:20.676777 INFO GET:http://192.168.1.32/?user/login.html 2023/01/10 10:00:20.676777 INFO use parent : false, 192.168.1.32:80 2023/01/10 10:00:20.677777 INFO conn 192.168.1.31:65084 - 0.0.0.0:38080 <-> 192. 168.1.32:53461 - 192.168.1.32:80 connected [192.168.1.32:80] 2023/01/10 10:00:20.697777 INFO conn 192.168.1.31:65084 - 0.0.0.0:38080 <-> 192. 168.1.32:53461- 192.168.1.32:80 released [192.168.1.32:80] 2023/01/10 10:00:23.409177 INFO CONNECT:sug.so.360.cn:443 2023/01/10 10:00:23.409177 INFO use parent : false, sug.so.360.cn:443 2023/01/10 10:00:25.798377 INFO CONNECT:sug.so.360.cn:443 2023/01/10 10:00:25.798377 INFO use parent : false, sug.so.360.cn:443 2023/01/10 10:00:26.161377 INFO GET:http://192.168.1.112/ 2023/01/10 10:00:26.161377 INFO use parent : false, 192.168.1.112:80 2023/01/10 10:00:26.163377 INFO conn 192.168.1.31:65087 - 0.0.0.0:38080 <-> 192. 168.1.32:53462 - 192.168.1.112:80 connected [192.168.1.112:80] 2023/01/10 10:00:26.189377 INFO conn 192.168.1.31:65087 - 0.0.0.0:38080 <-> 192. 168.1.32:53462- 192.168.1.112:80 released [192.168.1.112:80] 二级代理日志如下,提示http decoder read err: C:\Users\Administrator\Desktop\proxy-windows-amd64>proxy http -t tcp -p "0.0.0.0 :8083" -T kcp -P "192.168.1.32:38080" --kcp-key mypassword 2022/01/10 09:59:30.986955 INFO use kcp parent [192.168.1.32:38080] [ ROUNDROBIN ] 2022/01/10 09:59:31.009555 INFO tcp http(s) proxy on [::]:8083 2022/01/10 10:00:22.503755 INFO GET:http://192.168.1.32/?user/login.html 2022/01/10 10:00:22.503755 INFO use parent : true, 192.168.1.32:80 2022/01/10 10:00:22.503755 INFO conn 192.168.1.111:59477 - 192.168.1.31:8083 <-> 0.0.0.0:65084 - 192.168.1.32:38080 connected [192.168.1.32:80] 2022/01/10 10:00:23.503955 WARN decoder error , from 192.168.1.111:59478, ERR:ht tp decoder read err: http decoder read err: read tcp 192.168.1.31:8083->192.168. 1.111:59478: i/o timeout 2022/01/10 10:00:25.285955 INFO CONNECT:sug.so.360.cn:443 2022/01/10 10:00:25.285955 INFO use parent : true, sug.so.360.cn:443 2022/01/10 10:00:25.286955 INFO conn 192.168.1.111:59481 - 192.168.1.31:8083 <-> 0.0.0.0:65085 - 192.168.1.32:38080 connected [sug.so.360.cn:443] 2022/01/10 10:00:27.668955 INFO CONNECT:sug.so.360.cn:443 2022/01/10 10:00:27.669955 INFO use parent : true, sug.so.360.cn:443 2022/01/10 10:00:27.669955 INFO conn 192.168.1.111:59484 - 192.168.1.31:8083 <-> 0.0.0.0:65086 - 192.168.1.32:38080 connected [sug.so.360.cn:443] 2022/01/10 10:00:28.001955 INFO GET:http://192.168.1.112/ 2022/01/10 10:00:28.001955 INFO use parent : true, 192.168.1.112:80 2022/01/10 10:00:28.002955 INFO conn 192.168.1.111:59485 - 192.168.1.31:8083 <-> 0.0.0.0:65087 - 192.168.1.32:38080 connected [192.168.1.112:80] 2022/01/10 10:00:28.995955 WARN decoder error , from 192.168.1.111:59486, ERR:ht tp decoder read err: http decoder read err: read tcp 192.168.1.31:8083->192.168. 1.111:59486: i/o timeout ## Possible Solution <!--- Not obligatory, but suggest a fix/reason for the bug, --> ## Steps to Reproduce 首先启动一级代理 然后启动二级代理 浏览器设置代理 发现问题,代理失败 ## 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 : 12.3 1. full command is :proxy http -t tcp -p "0.0.0.0:8083" -T kcp -P "192.168.1.32:38080" --kcp-key mypassword 2. proxy http -t kcp -p "0.0.0.0:38080" --kcp-key mypassword 1. system is :win7 1. full log is: 上边已提交 2. 浏览器用的360极速浏览器21.0.1180 <!--- 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 --> 通过kcp协议代理http,代理失败,提示http decoder err ## Possible Implementation 无法推测原因
Author
Owner

@snail007 commented on GitHub (Jan 10, 2023):

fixed in v12.4 latest release, update: proxy update -f

<!-- gh-comment-id:1376740190 --> @snail007 commented on GitHub (Jan 10, 2023): fixed in v12.4 latest release, update: `proxy update -f`
Author
Owner

@jzbg commented on GitHub (Jan 11, 2023):

fixed in v12.4 latest release, update: proxy update -f

发现v12.4 版本kcp在socket5中使用时有问题,无法支撑ftp传输。

<!-- gh-comment-id:1378377182 --> @jzbg commented on GitHub (Jan 11, 2023): > fixed in v12.4 latest release, update: `proxy update -f` 发现v12.4 版本kcp在socket5中使用时有问题,无法支撑ftp传输。
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#421
No description provided.