Skip to content
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

IOS Proxy #280

Open
samerkh opened this issue Feb 18, 2023 · 1 comment
Open

IOS Proxy #280

samerkh opened this issue Feb 18, 2023 · 1 comment

Comments

@samerkh
Copy link

samerkh commented Feb 18, 2023

I can't seem to make it connect with my iphone, i installed the ca.pem on my iphone under settings>general>vpn & device management>configuration profiles. and it shows there as NodeMITMProxyCA. I also gave it root access under general>about>certificate trust settings. and enabled the NodeMITMProxyCa
under wifi settings i set up the proxy ip and port but it shows that my iphone is not connected to the internet. When i run netstat -ano | findstr :8000 i get TCP 127.0.0.1:8000 0.0.0.0:0 LISTENING 12744
not sure why my iphone does not reach the proxy server, i tried turning off firewall.
I'm only trying to run this simple code

const Proxy = require('http-mitm-proxy').Proxy;
const proxy = new Proxy();

proxy.onRequest((ctx, callback) => {
  console.log(`Request: ${ctx.clientToProxyRequest.method} ${ctx.clientToProxyRequest.url}`);
  console.log(`Headers: ${JSON.stringify(ctx.clientToProxyRequest.headers)}`);

  return callback();
});

proxy.onResponse((ctx, callback) => {
  console.log(`Response: ${ctx.serverToProxyResponse.statusCode}`);
  console.log(`Headers: ${JSON.stringify(ctx.serverToProxyResponse.headers)}`);

  return callback();
});

proxy.onError(function(ctx, err, errorKind) {
  console.log(errorKind,err);
});

proxy.listen({ port: 8000 }, () => {
  console.log('Listening on port 8000...');
});


@qiyu2580
Copy link

try

proxy.listen({ port: 8000, host: '0.0.0.0' }, () => {
  console.log('Listening on port 8000...');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants