node.jshttpsproxycharles-proxy

HTTPS proxy like Charles


I want to implement proxy server in node.js which is somewhat similar to Charles proxy - it should intercept HTTPS requests from my mobile app, decipher them, route some of them depending on body content to original backend and mock others with some static files.

  1. How this HTTPS stuff is handled in Charles or other proxies?
  2. Will I need self-signed root certificateon mobile device?
  3. Are there any libraries which will help me?

Solution

    1. How this HTTPS stuff is handled in Charles or other proxies?

    Technically, Charles Proxy or Proxyman.io (the one I'm using now) would do the following steps:

    GET https://api.producthunt.com/v1/posts HTTP/1.1
    
    1. Will I need self-signed root certification mobile device?

    Yes, you must install the Root Certificate in the first steps to your iOS device. For the Header/Response detail. Check chls.pro/ssl or proxy.man/ssl from those Charles or Proxyman, and see the content.

    You can do it on iOS Simulator by using ADVTrustStore

    1. Are there any libraries which will help me?

    You can check the those famous open source to see how it works - mitmproxy - zapproxy - http toolkit

    Hope this can help you.