nadoo / glider

glider is a forward proxy with multiple protocols support, and also a dns/dhcp server with ipset management features(like dnsmasq).
GNU General Public License v3.0
3.19k stars 439 forks source link

Forward HTTP with Luminati #333

Closed bogisi closed 2 years ago

bogisi commented 2 years ago

I use glider as a http proxy forwarder to forward http to another http proxy. The configuration is:

listen=http://127.0.0.1:1
forward=<username>:<password>@zproxy.lum-superproxy.io:22225

the error message is:

client.go:68: [http] 'CONNECT' to ports other than 443 are not allowed by proxy zproxy.lum-superproxy.io:22225
server.go:89: [http] 127.0.0.1:51154 <-> www.google.com:80 [c] via zproxy.lum-superproxy.io:22225, error in dial: [http] can not connect remote address: www.google.com:80. error code: 403

The reason is that zproxy.lum-superproxy.io not allow 'CONNECT' method to port other than 443 and glider uses 'CONNECT' method to forward the HTTP and HTTPS request.

Is there any way to solve this problem? i am having problems forwarding with brightdata.com / luminati.io

curl log with proxy

root@localhost:~# curl -x http://username:password@zproxy.lum-superproxy.io:22225 ip-api.com/json -vv
*   Trying 134.209.98.92...
* TCP_NODELAY set
* Connected to zproxy.lum-superproxy.io (134.209.98.92) port 22225 (#0)
* Proxy auth using Basic with user 'username'
> GET http://ip-api.com/json HTTP/1.1
> Host: ip-api.com
> Proxy-Authorization: Basic xxxxxxxxxxxxx
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 OK
< Date: Wed, 29 Jun 2022 10:40:56 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 289
< Access-Control-Allow-Origin: *
< X-Ttl: 43
< X-Rl: 43
< x-luminati-ip: rd81e648cb54c4c96f1452427356ac6de
< x-luminati-timeline: z27641-init:0,auth:211,dns_resolve:2,p2p_init:4,p2p_conn:225,response:221,dn_1b:0
< x-luminati-tun-timeline: init:0,connect:80
< connection: keep-alive
< 
* Connection #0 to host zproxy.lum-superproxy.io left intact
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.