But it's completely unintuitive! I can't know if i need to bother the user about proxy configuration before trying with no proxy, but trying to use that disallows the use of any other.
Trying to wrap Proxy.NO_PROXY to circumvent that, even if technically possible, just makes the code fail in the next line. if (p.type() != Proxy.Type.SOCKS) throw new SocketException("Unknown proxy type : " + p.type()); I'm doing this because it's the natural way to create the behavior i want, only bugging the user for the proxy if needed. If you have another idea that doesn't involve bogus requests to google.comor other "know assumed forever" sites i'd like to hear it.