Comments (4)
Hi,
Yes this looks even better. I will need to write some more extensive unit tests
for this method and then see if this is all covered by the implementation.
Thanks for your good input.
Have fun,
- Rossi
Original comment by [email protected]
on 24 Mar 2011 at 2:56
- Changed state: Accepted
from proxy-vole.
Hi, the current (SVN) Version still lacks resolving the host for isInNet. If
host is an hostname a NumberFormatException is thrown.
Why not use a fallback method to parse the hostname (disregarding the costs for
DNS resolving..):
private long parseIpAddressOrHostToLong(String host) {
long result = 0;
try {
result = parseIpAddressToLong(host);
} catch (NumberFormatException e) {
result = parseIpAddressToLong(dnsResolve(host));
}
return result;
}
.. it's easier to implement then an automatic notification "please use the
already resolved IP Address for all the isInNet calls" sent to the "pac script
writer".
Original comment by [email protected]
on 24 May 2012 at 9:45
from proxy-vole.
Hi, today I stucked in this isInNet problem and this solutions worked for me,
too! So to make it easy to the others:
1. Check out the latest SVN Version and open it in Eclipse, for example.
2. Open the com.btr.proxy.selector.pac.PacScriptMethods class.
3. Find the function isInNet and replace it with the following two funcs:
public boolean isInNet(String host, String pattern, String mask) {
long lhost = parseIpAddressOrHostToLong(host);
long lpattern = parseIpAddressToLong(pattern);
long lmask = parseIpAddressToLong(mask);
boolean result = (lhost & lmask) == lpattern;
return result;
}
private long parseIpAddressOrHostToLong(String host) {
long result = 0;
try {
result = parseIpAddressToLong(host);
} catch (NumberFormatException e) {
result = parseIpAddressToLong(dnsResolve(host));
}
return result;
}
Thanks you, [email protected]
Тoshe
Original comment by [email protected]
on 24 May 2012 at 1:53
from proxy-vole.
Hi,
It took some time. Finally I fixed this (hopefully)
Please check out the newest version.
Have fun,
- Rossi
Original comment by [email protected]
on 27 Jul 2012 at 9:30
- Changed state: Fixed
from proxy-vole.
Related Issues (20)
- OSX: proxy-vole ignores PAC proxy settings HOT 8
- Return of myIpAddress will treated by JavaxPacScriptParser as an object with following side effects. HOT 1
- proxy-vole is selecting bluetooth interface in OS/X 10.8 HOT 5
- The proxy selector is taking long time after updating windows ( in windows7 ) HOT 2
- Invalid java.io.tmpdir will cause NullPointerException in static initializer which leads to ExceptionInInitializerError HOT 1
- NullPointerException when PAC file not available HOT 3
- Improper logic to reload PAC file HOT 2
- ProxyListFallbackSelector returns a proxy rather than DIRECT when asked the proxy for the proxy.
- Local bypass in IE is ignored if additional whitelist-entries are defined HOT 1
- UnsatisfiedLinkError HOT 1
- DefaultWhiteListParser cannot handle www.*.com
- ProxySearch using default is giving erroneous proxy HOT 1
- Improvement in proxy fallback selection
- shExpMatch for IP address HOT 3
- Apache Httpclient 4 - not reading proxy settings from proxy-vole HOT 2
- Cannot detect Linux EVN_VAR IPv6 proxy
- JavaProxySearchStrategy only enabled with HTTP system properties given HOT 1
- Security-Exception with PAC script in Java 8
- SOCKS implementation is wrong
- NPE in IEProxySearchStrategy.getProxySelector()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxy-vole.