jromwu / masquerade Goto Github PK
View Code? Open in Web Editor NEWAn implementation of MASQUE in Rust
An implementation of MASQUE in Rust
Hi,
I was looking for a way to proxy my connection with Instagram using a proxy that sends requests over HTTP/3 and returns responses in HTTP/1.1. Is this project intended to serve a similar purpose?
While trying to set up and execute the project, I encountered some issues with the provided code. Here's what happened:
Initially, I executed the server with the following command:
cargo run --bin server -- 127.0.0.1:4433
Then, I executed the client using this command:
cargo run --bin client -- 127.0.0.1:4433 127.0.0.1:8989 http
However, I received an error message that stated:
thread 'main' panicked at 'UDP socket send_to() failed: Os { code: 56, kind: Uncategorized, message: "Socket is already connected" }'
To resolve this issue, I made the following changes to the code:
At line 155 in client.rs:
let (write, send_info) = conn.send(&mut out).expect("initial send failed");
// while let Err(e) = socket.send_to(&out[..write], send_info.to).await {
while let Err(e) = socket.send(&out[..write]).await {
if e.kind() == std::io::ErrorKind::WouldBlock {
debug!("send_to() would block");
continue;
}
panic!("UDP socket send_to() failed: {:?}", e);
}
debug!("written {}", write);
At line 476 in client.rs:
// match socket.send_to(&out[..write], send_info.to).await {
match socket.send(&out[..write]).await {
Ok(written) => debug!("{} written {} bytes out of {}", conn.trace_id(), written, write),
Err(e) => panic!("UDP socket send_to() failed: {:?}", e),
}
After making this change, the code executed without any errors. Is this approach correct?
Finally, I would like to ask if it's possible to use an existing TCP/SOCKS5 proxy hosted on a remote server as a way to establish a QUIC-encapsulated connection, or if it's only possible to do this using pre-existing interfaces on localhost?
Thank you for your help!
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:
Client:
RUST_LOG=debug cargo run --bin client -- 127.0.0.1:4433 127.0.0.1:8989 socks5
Server
RUST_LOG=debug cargo run --bin server -- 127.0.0.1:4433
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
Hello,
I'm doing some experience on Masquerade and wanted to analyze the traffic using Wireshark
To do so, I need QUIC secrets to allow Wireshark to decipher the QUIC packet. I tried using the environment variable SSLKEYLOGFILE but it didn't get populated.
Would you happen to have any idea how to do it?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.