There may be instances where you do not want some request to go through the proxy. For e.g lets imaging you do not want to go through the proxy on a localhost call or when you are calling foo.com. Is it possible to do this? Of course and you could do it by adding the following system property "http.nonProxyHosts",
The http.nonProxyHosts can be set to specify the hosts which should be connected to directly (not through the proxy server). The value of the http.nonProxyHosts property can be a list of hosts, each separated by | (the pipe character). It can also take a regular expression for matches for example: *.sfbay.sun.com would match any fully qualified hostname in the sfbay domain.
For more information you could refer http://java.sun.com/features/2002/11/hilevel_network.html.