jvilk / mitmproxy-node Goto Github PK
View Code? Open in Web Editor NEWA bridge between Python's mitmproxy and Node.JS programs. Rewrite network requests using Node.JS!
A bridge between Python's mitmproxy and Node.JS programs. Rewrite network requests using Node.JS!
> [email protected] postinstall /Users/ewhite/.nvm/versions/node/v10.7.0/lib/node_modules/mitmproxy
> scripts/install_python_deps.py
Traceback (most recent call last):
File "scripts/install_python_deps.py", line 18, in <module>
version[2] = int(version[2])
ValueError: invalid literal for int() with base 10: '4\\nPython:'
Looks like format given isn't expected
mitmdump --version
Mitmproxy: 4.0.4
Python: 3.7.0
OpenSSL: OpenSSL 1.0.2o 27 Mar 2018
Platform: Darwin-16.7.0-x86_64-i386-64bit
I'm trying to run BLeak on macOS, but it fails to start MITMProxy through mitmproxy-node. It appears that waitForPort(8080, 1);
at src/index.ts:361 resolves successfully even though MITMProxy is not running.
I have confirmed that there is nothing listening on port 8080:
➜ ~ lsof -nP -i4TCP:8080 | grep LISTEN
➜ ~
macOS: 10.13.6
Node: 8.15.1
Python: 3.7.2
Trying to npm install
BLeak, but am running into an issue with mitmproxy-node failing its postinstall script. Here is the error message:
> [email protected] postinstall C:\Users\jforcier\AppData\Roaming\npm\node_modules\mitmproxy
> scripts/install_python_deps.py
'scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `scripts/install_python_deps.py`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jforcier\AppData\Roaming\npm-cache\_logs\2018-09-24T19_40_06_833Z-debug.log
Cloning the repo and replacing the postinstall path with the direct path is my current work around. This is reproducible on multiple windows computers, but I don't have easy access to other OSs to see whether its windows only or not.
Hello,
When I'm calling MITMProxy.Create
, I keep getting the error ModuleNotFoundError: No module named 'websockets'
at mitmproxy/scripts/proxy.py
, line 15.
Do you have any idea what is causing this and how to fix it?
Thanks,
-tlf
$ npm install --save mitmproxy
> [email protected] postinstall /Users/levi/Desktop/.../mitmproxy
> scripts/install_python_deps.py
['version:']
Traceback (most recent call last):
File "scripts/install_python_deps.py", line 17, in <module>
version[0] = int(version[0])
ValueError: invalid literal for int() with base 10: 'version:'
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `scripts/install_python_deps.py`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
Log file:
112 verbose stack Error: [email protected] postinstall: `scripts/install_python_deps.py`
112 verbose stack Exit status 1
112 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
112 verbose stack at EventEmitter.emit (events.js:182:13)
112 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
112 verbose stack at ChildProcess.emit (events.js:182:13)
112 verbose stack at maybeClose (internal/child_process.js:962:16)
112 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
113 verbose pkgid [email protected]
114 verbose cwd /Users/Levi/...
115 verbose Darwin 18.0.0
116 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "mitmproxy"
117 verbose node v11.0.0
118 verbose npm v6.4.1
119 error code ELIFECYCLE
120 error errno 1
121 error [email protected] postinstall: `scripts/install_python_deps.py`
121 error Exit status 1
122 error Failed at the [email protected] postinstall script.
122 error This is probably not a problem with npm. There is likely additional logging output above.
123 verbose exit [ 1, true ]
$ python3 scripts/install_python_deps.py
['version:']
Traceback (most recent call last):
File "scripts/install_python_deps.py", line 17, in <module>
version[0] = int(version[0])
ValueError: invalid literal for int() with base 10: 'version:'
$ mitmproxy --version
Mitmproxy version: 2.0.2 (release version) Precompiled Binary
Python version: 3.5.2
Platform: Darwin-18.0.0-x86_64-i386-64bit
SSL version: OpenSSL 1.0.2j 26 Sep 2016
Mac version: 10.14 ('', '', '') x86_64
$ python3 -V
Python 3.7.1
$ node -v
v11.0.0
$ npm -v
6.4.1
mitmproxy-node
does not work with Python 3.7 right now because it depends on the Python websockets package, which is currently incompatible with Python 3.7:
python-websockets/websockets#431
I should update the mitmproxy package once Websockets updates with Python 3.7 support.
Workaround is to install websockets from the GitHub repository:
pip3 install -U git+https://github.com/aaugustin/websockets
When using mitmproxy
7.0.3 I see this error intermittently.
The mitmproxy
API seems to have changed and the syntax is now http.Response.make()
. I'll submit a PR.
Hi, I'm running the following test script
import MITMProxy from 'mitmproxy';
async function main() {
const interceptPaths = [
'/eval'
]
const mitmProxy = await MITMProxy.default.Create(undefined, interceptPaths, false);
}
main();
Got error:
MITMProxy not running; starting up mitmproxy.
Loading script /Users/.../mitmproxy-test-local/node_modules/mitmproxy/scripts/proxy.py
in script /Users/.../mitmproxy-test-local/node_modules/mitmproxy/scripts/proxy.py: No module named 'websockets'
Under env:
I've been stuck for a whole day and it's the critical dependency for my project, could you please give some instructions on this issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.