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。

Home Page:https://snail007.host900.com/goproxy/manual/zh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i/o timeout when some clients connect to the proxy

KewaiiGamer opened this issue · comments

Expected Behavior

Client should be able to connect to proxy

Current Behavior

goproxy is giving i/o timeout when some clients try to connect.

Steps to Reproduce

  1. Setup goproxy with the following command
  2. proxy http -t tcp -p :8000 --auth-nouser --auth-url http://127.0.0.1:3000/auth
  3. Connect to proxy via client
  4. Proxy will give i/o on some clients. Not all however

Context (Environment)

  1. proxy version is : commercial_12.5
  2. full command is proxy http -t tcp -p :8000 --auth-nouser --auth-url http://127.0.0.1:3000/auth
  3. system is : ubuntu 20.04
  4. error example in log: 2023/01/22 00:38:52.883349 WARN decoder error , from 33.5.2.76:50727, ERR:http decoder read err: http decoder read err: read tcp 192.168.0.5:8000->33.5.2.76:50727: i/o timeout

Detailed Description

As I have discussed on telegram not all customers have this issue. Dev already said it is issue with client not sending correct http header.

Possible Implementation

This is the line of code on free version where the eror happens.

err = fmt.Errorf("http decoder read err:%s", err)

I also noticed the maximum bytes used on conn.Read() is defined as 4096 as seen at
req, err := utils.NewHTTPRequest(&inConn, 4096, s.IsBasicAuth(), &s.basicAuth)

Note: I have the commercial version

try increase read buffer, --http-header-buffer=8192 or greater