Java Socket(Proxy proxy) Constructor

Syntax

Socket(Proxy proxy) constructor from Socket has the following syntax.

public Socket(Proxy proxy)

Example

In the following code shows how to use Socket.Socket(Proxy proxy) constructor.


import java.net.Proxy;
import java.net.Socket;
//w ww .j  ava2 s . com
public class Main {
  public static void main(String[] argv) throws Exception {
    Proxy proxy = Proxy.NO_PROXY;
    Socket socket = new Socket(proxy);
  }
}




















Home »
  Java Tutorial »
    java.net »




CookieManager
CookiePolicy
CookieStore
DatagramPacket
DatagramSocket
HttpCookie
HttpURLConnection
InetAddress
JarURLConnection
MulticastSocket
ServerSocket
Socket
SocketAddress
URI
URL
URLConnection
URLDecoder
URLEncoder