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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to have automation like mitmproxy , cause on my android 14 httptoolkit works fine else doesnot work #591

Open
sanjeev45 opened this issue May 18, 2024 · 7 comments

Comments

@sanjeev45
Copy link


Does this affect you too? Click below and add a 馃憤 to vote for this and help decide where HTTP Toolkit goes next, or go vote on the other most popular ideas so far.

@sanjeev45 sanjeev45 reopened this May 18, 2024
@pimterry
Copy link
Member

Hi @sanjeev45, can you share more info about your use case, and exactly what kind of automation you're looking for? It would be helpful if you can share as much detail as possible, and examples of specific automations you'd like to create.

There are other existing proposals for scripting use cases (such as #37) but from this issue alone I'm not sure if that would provide what you're looking for.

@sanjeev45
Copy link
Author

Hi @pimterry I鈥檝e been using HTTP Toolkit and it鈥檚 been incredibly useful. However, I find myself often needing to intercept and modify traffic in a way similar to how mitmproxy allows with its Python scripting capabilities. This would save me from having to manually copy and paste each time. Would it be possible to consider adding such a feature to HTTP Toolkit? I believe it would greatly enhance the tool鈥檚 functionality and be beneficial to many users. Thank you for considering my request.

@pimterry
Copy link
Member

Hi @sanjeev45, please share specific information about your use case - there are a million different things that could be scriptable, so it's not clear what you're looking for. It sounds like you want to copy & paste something?

Please describe exactly what you want the script to do and why:

I would like to [x], which is useful to me because of [y].
To do that, I want to create a script so that when [a] happens, HTTP Toolkit does [b], [c], [d]...

Does that make sense? It's not really possible to design or build this feature without more information about what you're looking for.

@sanjeev45
Copy link
Author

sanjeev45 commented May 21, 2024

HI @pimterry
The specific features I'm referring to are:

  1. Scripting and Automation: A Python API or similar to automate the interception and manipulation of HTTP(S) traffic.

  2. URL Filtering and Interaction with Python Scripts: The ability to filter requests based on the URL, print the URL directly, and interact with other Python scripts.

@pimterry
Copy link
Member

"automate the interception and manipulation" means 100,000 different things. This is a generic description that is not useful.

Please provide an example of a specific script you want to write and explain why. I have given a clear example of the information required above.

I would like to [x], which is useful to me because of [y].
To do that, I want to create a script so that when [a] happens, HTTP Toolkit does [b], [c], [d]...

Like "I'm trying to test how a server handles different request headers, so I want to write a script that where every time a request is sent to example.com, it adds a header HELLO: VALUE to the request". Please be as specific and detailed as possible.

It's not possible to build features without explaining exactly what you want it to do. If you can't share that info I'm afraid I'll have to close this issue.

@sanjeev45
Copy link
Author

sanjeev45 commented May 21, 2024

`from mitmproxy import http

def request(flow: http.HTTPFlow) -> None:
# If the request URL contains "pdf"
if "pdf" in flow.request.pretty_url:
# Print the URL
print(flow.request.pretty_url)` here's an example about what iam talking about

@pimterry
Copy link
Member

Thanks, that's a bit clearer.

Presumably you would want the print command here to write to a file somewhere? Unlike CLI tools HTTP Toolkit it doesn't make much sense for HTTP Toolkit to log directly to the console.

Would you want a single file, or to be able to configure an output file per rule/script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants