httptoolkit icon indicating copy to clipboard operation
httptoolkit copied to clipboard

can you add an option to add all ports?

Open hpp0hpp opened this issue 1 year ago • 6 comments

Sometimes I don't know which port the app will use beforehand, so I would like to redirect all ports as http request, is there any way I can do that?

hpp0hpp avatar May 26 '23 14:05 hpp0hpp

There's a few different places that ports are managed (the proxy port on the computer, the ports to match in mock rules, the forcibly redirected ports in the Android app, and probably others). Can you explain which one you mean, and a bit more context about what you're trying to do?

pimterry avatar May 26 '23 16:05 pimterry

I want to add all ports for the forcibly redirected ports in the Android app. Because sometimes I need to study other app's behavier, I don't know what ports it will use, they may use strange port for some request, which makes me lost track of it. So I want to add all ports on the Android app. Thank you.

@pimterry

hpp0hpp avatar Jun 01 '23 09:06 hpp0hpp

HTTP Toolkit does set the HTTP proxy configuration on the device, in addition to manual port redirection - redirection is just a backup mechanism. In most cases, that should capture all network traffic even if no ports are redirected.

The issue with capturing all ports is there are Android components that may send non-HTTP traffic on the network. If that traffic is intercepted, it will break, as HTTP Toolkit cannot intercept unknown protocols.

Hmm that said, this could be usable when also filtering interception to just a single target app.

I'm open to extending the Android app with an option to do this, if the UX makes the implications clear. PRs welcome if you're interested.

pimterry avatar Jun 01 '23 09:06 pimterry

@pimterry

I try to start a PR, it's too diffcult for me, I am not a professional coder. I try change some thing, download the android studio, and read the code. but I don't even know where to start.

hpp0hpp avatar Jun 07 '23 08:06 hpp0hpp

Fair enough. I'm afraid I don't have time to work on it myself though, and I think for most cases it's not required (as above) so it's not a key feature I'm going to be able to prioritize any time soon. If you do manage to get this working, or if anybody else is interested then PRs are welcome.

pimterry avatar Jun 07 '23 08:06 pimterry

I also often notice that when intercepting apps I don't see any requests from them, because it uses some obscure port (like 31415 for example) and it does not get intercepted. I tried adding it to the manual redirection list, and then it showed up. But it would still be nice if it got intercepted automatically. wouldnt it be possible to intercept all traffic, and only show it in the view if it is a parseable protocol? and have an option to show raw data of other protocols if ppl are interested in that, idk. And yes as u said, this would be really useful if combined with filtering on just the app you are looking at, so you will only get traffic from that specific app :)

zupd avatar May 25 '24 01:05 zupd