I want to define specific proxy according the network I am connected and I tried to apply this solution, but this line:
var ip = myIpAddress();
Does not give me the IP address of my wired interface but the address of one of my virtual interface (I have VMPlayer installed).
Is there any way to get the current IP for a defined interface inside the proxy pac file?
UPDATE: I tried to change the order of the interfaces in the Control Panel\Network and Internet\Network Connections view, choose Advanced -> Advanced Settings.
By this way I was able to put the LocalNetwork (wired) before the Wireless Network and the virtuals networks VMNet1 and VMNet8 at the end, Once it did work but it seems not to be stable as currently the myIpAddress() function is still giving me a ipv6 from the vmnet8 interface even it is in the bottom of the priority list.
I saw also some solution where they use a function called
myIpAddressEx(); but it does not look to work under Windows 7.
The only viable solution for such problematic seems to have your own proxy software installed and put redirection rules inside it.