jvilk / mitmproxy-node

A bridge between Python's mitmproxy and Node.JS programs. Rewrite network requests using Node.JS!
92 stars 15 forks source link

No module named 'websockets' #15

Open foreseaz opened 2 years ago

foreseaz commented 2 years ago

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?

foreseaz commented 2 years ago

The example repo is here, and the error is in the README

foreseaz commented 2 years ago

Resovled by venv, fix PR here https://github.com/nleak/mitmproxy-test-local/pull/1