zhsj/wghttp

only http works?

Closed this issue · 8 comments

root@FriendlyWrt:/etc/warp#  curl g.co --proxy socks5://127.0.0.1:31080
curl: (97) connection to proxy closed
root@FriendlyWrt:/etc/warp#  curl g.co --proxy http://127.0.0.1:31080
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://g.co/">here</A>.
</BODY></HTML>

Try curl https://g.co --proxy http://127.0.0.1:31080

I means I hope wghttp can listen socks proxy request:

curl g.co --proxy socks5://127.0.0.1:31080

but now, it does not work.

wghttp is not a SOCKS proxy, it is an HTTP proxy. You can still send HTTPS traffic over it using my example above.

wghttp is not a SOCKS proxy, it is an HTTP proxy. You can still send HTTPS traffic over it using my example above.

But quoted in its README.md ,wghttp is a "HTTP & SOCKS proxy"

You are right. Pardon my misunderstanding. I was able to reproduce the same error you are getting with curl.

zhsj commented

Try curl -v g.co --proxy socks5h://127.0.0.1:31080 and paste the verbose log here.

Try curl -v g.co --proxy socks5h://127.0.0.1:31080 and paste the verbose log here.

This time , it works:

root@FriendlyWrt:/etc/warp# curl -v g.co --proxy socks5h://127.0.0.1:31080
> GET / HTTP/1.1
> Host: g.co
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Location: https://g.co/
< Cross-Origin-Resource-Policy: cross-origin
< X-Content-Type-Options: nosniff
< Server: sffe
< Content-Length: 210
< X-XSS-Protection: 0
< Date: Sat, 13 Jan 2024 15:00:47 GMT
< Expires: Sat, 13 Jan 2024 15:30:47 GMT
< Cache-Control: public, max-age=1800
< Content-Type: text/html; charset=UTF-8
< Age: 401
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://g.co/">here</A>.
</BODY></HTML>
root@FriendlyWrt:/etc/warp#

and now, curl g.co --proxy socks5://127.0.01:31080 also works!

root@FriendlyWrt:/etc/warp# curl g.co --proxy socks5://127.0.0.1:31080
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="https://g.co/">here</A>.
</BODY></HTML>
root@FriendlyWrt:/etc/warp#