简体   繁体   中英

How to detect the presence of a HTTP proxy in Node.js?

I'd like to be able to detect when such programs / proxy are open on the computer (eg Fiddler or Charles) on Node.js.

Do the programs change your local IP address, and I just need to detect it? Not sure what the appropriate package I should use if that is the case. Thank you.

Thank you

If it's Charles Proxy or Fiddler, they run on the local machine and the interception is transparent - so neither the IP changes, nor do they add an HTTP header to disclose that they are present. As these tools are used in security tests it would be detrimental for them to announce their presence as the software under test could detect them and behave differently.

Normal web proxies like Squid or load balancer setups should add one of the following HTTP headers, though:

  • Via for example Via: 1.1 vegur
  • X-Forwarded-For for example X-Forwarded-For: 192.168.1.10

So for local MITM proxies like Charles or Fiddler, you won't be able to detect their presence but regular proxies should make themselves known through some HTTP header.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM