File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
test/jdk/java/net/HttpURLConnection Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 4848
4949public class HttpURLConWithProxy {
5050
51+ private static Logger logger =
52+ Logger .getLogger ("sun.net.www.protocol.http.HttpURLConnection" );
53+
5154 public static void main (String ... arg ) throws Exception {
5255 // Remove the default nonProxyHosts to use localhost for testing
5356 System .setProperty ("http.nonProxyHosts" , "" );
5457
5558 System .setProperty ("http.proxyHost" , "1.1.1.1" );
5659 System .setProperty ("http.proxyPort" , "1111" );
57- String HTTPLOG = "sun.net.www.protocol.http.HttpURLConnection" ;
58- Logger .getLogger (HTTPLOG ).setLevel (Level .ALL );
60+
61+ // Use the logger to help verify the Proxy was used
62+ logger .setLevel (Level .ALL );
5963 Handler h = new ProxyHandler ();
6064 h .setLevel (Level .ALL );
61- Logger . getLogger ( HTTPLOG ) .addHandler (h );
65+ logger .addHandler (h );
6266
6367 ServerSocket ss ;
6468 URL url ;
You can’t perform that action at this time.
0 commit comments