Name

Proxy

Synopsis

An instance of this class represents a set of proxy server settings: a network address and a proxy server type. The NO_PROXY constant represents a Proxy.Type.DIRECT connection. Proxy objects may be passed to the Socket( ) constructor or to the URL.openConnection( ) method to connect through a specific proxy server. The ProxySelector class provides a way to automate the selection of proxy servers based on requested URLs.

public class Proxy {
// Public Constructors
     public Proxy(Proxy.Type type, SocketAddress sa);  
// Public Constants
     public static final java.net.Proxy NO_PROXY;  
// Nested Types
     public enum Type; 
// Public Instance Methods
     public SocketAddress address( );  
     public Proxy.Type type( );  
// Public Methods Overriding Object
     public final boolean equals(Object obj);  
     public final int hashCode( );  
     public String toString( );  
}

Passed To

Socket.Socket( ), URL.openConnection( ), URLStreamHandler.openConnection( )

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.