jromwu / masquerade

An implementation of MASQUE in Rust
45 stars 7 forks source link

problem getting and end 2 end example with socks5 to work #3

Closed jglara closed 1 year ago

jglara commented 1 year ago

Hi,

I was trying to run the example provided in the README, but I can not find a way to properly provide the :path header to establish the tunnel using a socks interface. This is what I have tried:

From the logs I find the http3 connection between client and server is established, then I try to open a socks5 connection to the client: nc -X 5 -x 127.0.0.1:8989 127.0.0.1 7777

and wait for traffic to be received in 127.0.0.1:7777 nc -l -u 127.0.0.1 7777

but the connection is not established: 2023-04-17T11:01:53.127Z INFO masquerade_proxy::client] sending HTTP3 request [":method: CONNECT", ":path: 127.0.0.1:7777", ":protocol: connect-udp", ":scheme: dummy-scheme", ":authority: dummy-authority", ":authorization: dummy-[2023-

04-17T11:01:53.131Z INFO masquerade_proxy::server] e67f06407f71f425ed7a7cc3ab94af4d4a992126 got request [(":method", "CONNECT"), (":path", "127.0.0.1:7777"), (":protocol", "connect-udp"), (":scheme", "dummy-scheme"), (":authority", "dummy-authority"), (":authorization", "dummy-authorization")] on stream id 4authorization"]

Looks like the :path header is not compliant with the expected format: // for now, let's assume path pattern is "/something.../target-host/target-port/"

but I don't see how can I do that using nc, or other socks5 client

jromwu commented 1 year ago

Hi there,

Sorry I cannot really reproduce the issue. It looks like to me though that the first netcat command is initiating a connection in TCP and the second is listening for UDP. When I tried to initiate UDP connection with socks5, netcat told me that proxying UDP is not supported (at least for my netcat on Ubuntu 22.04).

I see that you forked the repo and tried to fix it. Did you finally get it working?

Cheers!

jglara commented 1 year ago

Hi,

Thanks for the answer. I made some changes in the forked repo and could make the basic HTTP 1.1 CONNECT >> QUIC/HTTP3 >> UDP scenario.