How to run mitmproxy in Heroku?

33 views Asked by At

I am using mitmproxy with Python. Python version is 3.11.0 and mitmproxy version is 10.2.0. When I install mitmproxy, it installed other dependencies such as

mitmproxy-macos==0.5.1
mitmproxy_rs==0.5.1
urwid-mitmproxy==2.1.2.1

When I run in my local environment, it works fine but when I tried to run in Heroku, it returns an error. The error looks like this

Traceback (most recent call last):
  File "/app/.heroku/python/bin/mitmdump", line 5, in <module>
     from mitmproxy.tools.main import mitmdump 
ModuleNotFoundError: No module name 'mitmproxy.tools'

When I check build log in Heroku, the package is installed properly with same version that I have in my local environment.

After running Python main File, I am running mitmproxy as follows:

subprocess.Popen(['mitmdump', '-s', 'filepath']) 
0

There are 0 answers