qwj / python-proxy

HTTP/HTTP2/HTTP3/Socks4/Socks5/Shadowsocks/ShadowsocksR/SSH/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python 3 asyncio.
MIT License
2.01k stars 338 forks source link

quic not working #111

Open mosajjal opened 3 years ago

mosajjal commented 3 years ago

Hi,

just FYI, quic is not working as per documentation. I also tried this:

server: pproxy --ssl certificate.crt,certificate.key -ul http+quic://:443 -vv

but the client can't do this:

pproxy -ur http+quic://server:443 -vv

Cheers,

qwj commented 3 years ago

If the client is sending TCP, server and client should use -r and -l instead of -ur and -ul

mosajjal commented 3 years ago

I just tried this over localhost, still not working:

server: sudo pproxy --ssl certificate.crt,certificate.key -l http+quic://127.0.0.1:443 -vv client: pproxy -r http+quic://127.0.0.1:443 -vv

also, I thought QUIC was a UDP protocol?

mosajjal commented 3 years ago

btw this is the error I get when trying to run the mentioned QUIC client:

shot-2021-02-22T19:38:06+13:00

qwj commented 3 years ago

QUIC is listening on UDP port, but if you want to proxy TCP over QUIC, you should specify -l and -r. QUIC cannot be used standalone. You can use quic+http or quic+ss. What is the exact problem?

mosajjal commented 3 years ago

can you please provide a working example of a QUIC tunnel so I can test on my localhost. I've tried the example in docs, ss+quic and http+quic with no success.

qwj commented 3 years ago

The example I have put in docs should work. What is the error message?

qwj commented 3 years ago

btw this is the error I get when trying to run the mentioned QUIC client:

shot-2021-02-22T19:38:06+13:00

You should use quic+http:// instead of quic:// here.

mosajjal commented 3 years ago

image

in this screenshot, can you please help me find where did I put the config wrong. it looks like the client never finds the server.

qwj commented 3 years ago

image

in this screenshot, can you please help me find where did I put the config wrong. it looks like the client never finds the server.

Try "-l quic+http://0.0.0.0:1234" or "-l quic+http://127.0.0.1:1234". You can use following line instead of running a client every time:

$ pproxy -r http+quic://127.0.0.1:1234 --test http://ident.me
mosajjal commented 3 years ago

oh wow the problem was probably ipv6 all along. 127.0.0.1 in -l did the trick! thanks :) Also, nice tip about the --test. didn't know that

qwj commented 3 years ago

quic connection is very stable and useful for handling multiple streams in a single UDP port. I am using quic everyday. :)

mosajjal commented 3 years ago

have you tried QUIC+ws over a CDN?

qwj commented 3 years ago

I don't know whether CDN can handle QUIC properly. The HTTP3 (h3://) is based on QUIC, worth a try.

mosajjal commented 3 years ago

excellent :) will do. Thanks sir