HttpURLConnection UsingProxy() Example

Indicates if the connection is going through a proxy.


HttpURLConnectionclass UsingProxy() method example. This example shows you how to use UsingProxy() method.This method Indicates if the connection is going through a proxy.

Here is the code:-
/* 
 * @Program that Indicates if the connection is going through a proxy.
 * UsingProxy.java 
 * Author:-RoseIndia Team
 * Date:-25-Jun-2008
 */

import java.net.*;

public class UsingProxy {

    public static void main(String[] argsthrows Exception {
        URL url = new URL("http://192.168.10.211:8080");
        HttpURLConnection connection = (HttpURLConnectionurl.openConnection();
        System.out.println("connection is going through a proxy: "
                + connection.usingProxy());
    }
}

Output of the program:-
 connection is going through a proxy: false

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US