-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Added more commands to start applications with mitmproxy preconfigured #6035
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
base: main
Are you sure you want to change the base?
Conversation
Having @roniemartinez as the maintainer of pybrowser is a big plus, but I do not like the idea of adopting three new dependencies for this though (pywin32 and pyxdg are transitive). We also have a tested existing implementation for Chrome, so I'm not exactly sure what we are solving here. Honestly I feel the current approach of enumerating well-known paths and executable names may be a bit dumb, but it tends to work fine so far. |
I agree having new dependencies will be hard to manage
I was just migrating the current implementation to
If you want the same technique for firefox and other browsers I can do that instead of using pybrowser. |
I don't want to add pywin32 as a dependency if they don't ship abi3 wheels, so that's a hard no for me. |
5983e72
to
b2cfd6f
Compare
accident pushed this file sorry 🙇♂️
There are 2 methods to get firefox I am not sure if second one is good or not - enumerating well-known paths and executable names - If platform is windows firefox may be installed in some other locations so i am using powershell to get firefox path `(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet\Firefox-*\shell\open\command\')|findstr "default"` ``` (default) : "C:\Program Files\Mozilla Firefox\firefox.exe" ``` then using regex to get path
60396c7
to
5a135df
Compare
Just FYI. Version 1.0.0 no longer depends on |
Solution I am working on
to get the binary path of browsers I am using
pybrowser
made by roniemartinez. My original plan was to create my own library but since its already i will be using thisChrome
This is already done in mitmproxy
Firefox
There are 2 methods to get firefox I am not sure if second one is good or not
(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet\Firefox-*\shell\open\command\')|findstr "default"
then using regex to get path
mkdir %USERPROFILE%\AppData\Local\Mozilla\Certificates
for installing a certificate in Firefox
.pem
has to be copiedhttps://wiki.mozilla.org/CA/AddRootToFirefox#Installing_Certificates_Into_Firefox
cp mitmproxy-ca-cert.pem %USERPROFILE%\AppData\Local\Mozilla\Certificates\mitmproxy-ca-cert.pem
firefox --profile "<custom_pref_folder>/pref"
for firefox profile and proxy setting
https://wiki.mozilla.org/Firefox/CommandLineOptions#-profile_.22profile_path.22
all the steps will spawn a proxy configured firefox
Safari
I don't own a mac so can't do much here
if anyone wants to help it would be really great
Android
I have limited knowledge of android so will do more research
Docker-containers
setup proxy for all containers docs
by having these options in this config
~/.docker/config.json
I have created an addon
docker.py
with 2 commandsdocker.enable
: This will append the proxy object in the config and write it in the filesdocker.disable
: This will remove the proxy object from the config and write the filedocker Image has to be recreated or start new containers so that proxy is being used.
user has to copy the mitm certificate in the
/usr/local/share/ca-certificates/
either manually or via DockerfileChecklist
closes #5247