Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.ProxyClient.connect()


            client.getHostConfiguration().setHost(host, port);
            String proxyHost = proxyAddress.getAddress().toString().substring(0, proxyAddress.getAddress().toString().indexOf("/"));
            client.getHostConfiguration().setProxy(proxyHost, proxyAddress.getPort());
           
       
            ProxyClient.ConnectResponse response = client.connect();
            socket = response.getSocket();
            if (socket == null) {
                ConnectMethod method = response.getConnectMethod();
                // Read the proxy's HTTP response.
                if(method.getStatusLine().toString().matches("HTTP/1\\.\\d 407 Proxy Authentication Required")) {
View Full Code Here


        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

                    AuthScope.ANY,
                    new UsernamePasswordCredentials(proxyCredentials.getUsername(),
                        new String(proxyCredentials.getPasword())));
        }
        log.debug("Trying to connect to proxy");
        ProxyClient.ConnectResponse resp = proxyClient.connect();
        if (resp.getConnectMethod().getStatusCode() != HttpStatus.SC_OK) {
            log.error("Failed to connect. " + resp.getConnectMethod().getStatusLine());
            throw new GmailException("Failed connecting to IMAP through proxy: "
                    + resp.getConnectMethod().getStatusLine());
        }
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new HttpAuthRealm("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

        proxyclient.getState().setProxyCredentials(
            new AuthScope("10.0.1.1", 3128, null),
            new UsernamePasswordCredentials("proxy", "proxy"));
       
        // create the socket
        ProxyClient.ConnectResponse response = proxyclient.connect();
       
        if (response.getSocket() != null) {
            Socket socket = response.getSocket();
            try {
                // go ahead and do an HTTP GET using the socket
View Full Code Here

                    AuthScope.ANY,
                    new UsernamePasswordCredentials(proxyCredentials.getUsername(),
                        new String(proxyCredentials.getPasword())));
        }
        log.debug("Trying to connect to proxy");
        ProxyClient.ConnectResponse resp = proxyClient.connect();
        if (resp.getConnectMethod().getStatusCode() != HttpStatus.SC_OK) {
            log.error("Failed to connect. " + resp.getConnectMethod().getStatusLine());
            throw new GmailException("Failed connecting to IMAP through proxy: "
                    + resp.getConnectMethod().getStatusLine());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.