Code example for Proxy

Methods: type

0
    /** 
     * Returns connected socket to be used for this HTTP connection. 
     */ 
    private HttpConnection getHttpConnection(Proxy proxy) throws IOException {
        HttpConnection.Address address; 
        if (proxy == null || proxy.type() == Proxy.Type.DIRECT) {
            this.proxy = null; // not using proxy
            address = new HttpConnection.Address(uri);
        } else { 
            address = new HttpConnection.Address(uri, proxy, requiresTunnel());
        } 
        return HttpConnectionPool.INSTANCE.get(address, getConnectTimeout());
    } 
 
    /** 
     * Sets up the data streams used to send requests and read responses. 
     */ 
    protected void setUpTransportIO(HttpConnection connection) throws IOException {
        socketOut = connection.getOutputStream();
        socketIn = connection.getInputStream();
    }