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 4545
4646public class HttpURLConWithProxy {
4747
48+ private static Logger logger =
49+ Logger .getLogger ("sun.net.www.protocol.http.HttpURLConnection" );
50+
4851 public static void main (String ... arg ) {
4952 // Remove the default nonProxyHosts to use localhost for testing
5053 System .setProperty ("http.nonProxyHosts" , "" );
5154
5255 System .setProperty ("http.proxyHost" , "1.1.1.1" );
5356 System .setProperty ("http.proxyPort" , "1111" );
54- String HTTPLOG = "sun.net.www.protocol.http.HttpURLConnection" ;
55- Logger .getLogger (HTTPLOG ).setLevel (Level .ALL );
57+
58+ // Use the logger to help verify the Proxy was used
59+ logger .setLevel (Level .ALL );
5660 Handler h = new ProxyHandler ();
5761 h .setLevel (Level .ALL );
58- Logger . getLogger ( HTTPLOG ) .addHandler (h );
62+ logger .addHandler (h );
5963
6064 ServerSocket ss ;
6165 URL url ;
You can’t perform that action at this time.
0 commit comments