Showing results for 
Show  only  | Search instead for 
Did you mean: 

isInNet(myIpAddress() not working properly

We will implement network changes in the near future and while we're in between installs we need to modify the proxy file, for clients in certain subnets to go direct, and the rest go through the proxy. In the meantime I'm testing with my machine, but the results are unpredictable. This is my file:


function FindProxyForURL(url, host) {
    if (isInNet(dnsResolve(host), "", "") ||
    isInNet(dnsResolve(host), "", "") ||
    isInNet(myIpAddress(), "", 
 return "DIRECT";

    return "PROXY X.X.X.X:9090";

The part that is not working is

isInNet(myIpAddress(), "",

I am testing with my own IP, if I apply this file to a different system in the same subnet, but different IP, it also sends the traffic direct.

Does this function work with /24 subnet ranges only? Are there any known limitations.

What could be a different way to achieve the same result.

Thank you in advance,


3 Replies

Re: isInNet(myIpAddress() not working properly

I did find a typo in my proxy file, the correct line now is:

isInNet(myIpAddress(), "", "")

Still is not working. I tried to replace the subnet mask with a CIDR notation, no luck.


Former Member
Not applicable
Report Inappropriate Content
Message 3 of 4

Re: isInNet(myIpAddress() not working properly

This discussion is a really good read relevent to what you're seeing:

Former Member
Not applicable
Report Inappropriate Content
Message 4 of 4

Re: isInNet(myIpAddress() not working properly

I say its relevent because you're using the myIpAddress function which can be unreliable. You may gleen other info from that discussion though.

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community