News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Proxy Type() Example

Started by VelMurugan, Dec 30, 2008, 11:31 PM

Previous topic - Next topic

VelMurugan

Proxy Type() Example

Returns the proxy type.

Proxyclass Type() method example. This example shows you how to use Type() method.This method Returns the proxy type.

Here is the code:-

/*
* @Program that Returns a Type representing the proxy type
* Type.java
* Author:-RoseIndia Team
* Date:-23-Jun-2008
*/

import java.net.*;

public class Type {

    public static void main(String[] args) {
        SocketAddress ss = new InetSocketAddress("girish-desktop", 8080);
        Proxy p = new Proxy(Proxy.Type.SOCKS, ss);
        //Returns a Type representing the proxy type
        System.out.println("The proxy type is: "+p.type());
    }
}


Output of the program:-

The proxy type is: SOCKS


Source : codingdiary