Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request duplication #7

Open
emanuele-em opened this issue Feb 12, 2023 · 8 comments
Open

Request duplication #7

emanuele-em opened this issue Feb 12, 2023 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@emanuele-em
Copy link
Owner

It could be useful to add the possibility to duplicate every request

@emanuele-em emanuele-em added enhancement New feature or request good first issue Good for newcomers labels Feb 12, 2023
@SummerGram
Copy link

Hi, is it duplicate the request and send again?

@emanuele-em
Copy link
Owner Author

@SummerGram yes, replay every single request

@SummerGram
Copy link

mind if I take this?
I may need some help btw

@emanuele-em
Copy link
Owner Author

Sure why not

@SummerGram
Copy link

SummerGram commented Feb 18, 2023

@emanuele-em hi,

Will RequestResponse::Response(res) => return Ok(res), ever run in internal.rs?

How does the proxy send back response to the software like web browser?

pub(crate) async fn proxy( mut self, req: Request<Body>, ) -> Result<Response<Body>, hyper::Error>{
        let ctx = HttpContext {
            remote_addr: self.remote_addr,
        };

        let req = match self
            .http_handler
            .handle_request(&ctx, req)
            .await
        {
            RequestResponse::Request(req) => req,
            RequestResponse::Response(res) => return Ok(res),
        };

        if req.method() == Method::CONNECT{
            self.process_connect(req)
        } else if hyper_tungstenite::is_upgrade_request(&req){
            Ok(self.upgrade_websocket(req))
        } else {
            let res = self
                .client
                .request(normalize_request(req))
                .await?;

            Ok(self
                .http_handler
                .handle_response(&ctx, res)
                .await)
        }
    }

@emanuele-em
Copy link
Owner Author

You call internal directly from mitm_proxy::src::main.rs

read more about https connect method here

@SummerGram
Copy link

Hi @emanuele-em,

The proxy is in the other thread. It sends the request and response to the GUI. To allow the GUI duplicate the request, should we create a socket in the GUI to send the duplicated request to the address of the proxy?

@emanuele-em
Copy link
Owner Author

@SummerGram unfortunately I didn't have time yet to think about a good solution but from the gut maybe your solution isn't very idiomatic, it should be better to manage backend stuff from API, you can set a replay button that call a function in API passing the url maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants