Examples of ConnectMethod


Examples of com.maverick.http.ConnectMethod

                try {
                    int port = Integer.parseInt(proxyPort);

                    HttpClient client = new HttpClient(proxyHost, port, isSecure);
                    HttpMethod method = new ConnectMethod(url.getHost(), url.getPort() == -1 ? 443 : url.getPort(), true);

                    PasswordCredentials credentials = new PasswordCredentials();
                    credentials.setUsername(proxyUsername);
                    credentials.setPassword(proxyPassword);
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

           
       
            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")) {
                    // Proxy server returned 407. We will now try to connect with auth Header
                    if(proxyUsername != null && proxyPassword != null) {
                        socket = AuthenticateProxy(method, client,proxyHost, proxyAddress.getPort(),
                                proxyUsername, proxyPassword);
                    } else {
                        throw new ProtocolException("Socket not created: " + method.getStatusLine());
                    }
                }            
            }
           
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

        // Set the timeout (if non-zero)
        httpConn.setSoTimeout(JMeterUtils.getPropDefault("httpclient.timeout",0));

        httpState = new HttpState();
        if (httpConn.isProxied() && httpConn.isSecure()) {
            httpMethod = new ConnectMethod(httpMethod);
        }
       
        // Allow HttpClient to handle the redirects:
        httpMethod.setFollowRedirects(getPropertyAsBoolean(AUTO_REDIRECTS));
       
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

        // TODO make this a JMeter property
        httpMethod.setHttp11(!System.getProperty("http.version","1.1").equals("1.0"));

        httpState = new HttpState();
        if (httpConn.isProxied() && httpConn.isSecure()) {
            httpMethod = new ConnectMethod(httpMethod);
        }
       
        // Allow HttpClient to handle the redirects:
        httpMethod.setFollowRedirects(getPropertyAsBoolean(AUTO_REDIRECTS));
       
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

    // Set the timeout (if non-zero)
    httpConn.setSoTimeout(JMeterUtils.getPropDefault("httpclient.timeout", 0));

    httpState = new HttpState();
    if (httpConn.isProxied() && httpConn.isSecure()) {
      httpMethod = new ConnectMethod(httpMethod);
    }

    // Allow HttpClient to handle the redirects:
    httpMethod.setFollowRedirects(getPropertyAsBoolean(AUTO_REDIRECTS));
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

            } else if (method.equalsIgnoreCase(Method.DELETE.getName())) {
                this.httpMethod = new DeleteMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.CONNECT.getName())) {
                final HostConfiguration host = new HostConfiguration();
                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

            } else if (method.equalsIgnoreCase(Method.DELETE.getName())) {
                this.httpMethod = new DeleteMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.CONNECT.getName())) {
                final HostConfiguration host = new HostConfiguration();
                host.setHost(new URI(requestUri, false));
                this.httpMethod = new ConnectMethod(host);
            } else if (method.equalsIgnoreCase(Method.OPTIONS.getName())) {
                this.httpMethod = new OptionsMethod(requestUri);
            } else if (method.equalsIgnoreCase(Method.TRACE.getName())) {
                this.httpMethod = new TraceMethod(requestUri);
            } else {
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

                System.getProperty("http.proxyUserName"),
                System.getProperty("http.proxyPassword")));
        }

        if (connection.isProxied() && connection.isSecure()) {
            method = new ConnectMethod(method);
        }
        method.execute(state, connection);

        if (method.getStatusCode() == HttpStatus.SC_OK) {
            System.out.println(method.getResponseBodyAsString());
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

                System.getProperty("http.proxyUserName"),
                System.getProperty("http.proxyPassword")));
        }

        if (connection.isProxied() && connection.isSecure()) {
            method = new ConnectMethod(method);
        }
        method.execute(state, connection);

        if (method.getStatusCode() == HttpStatus.SC_OK) {
            System.out.println(method.getResponseBodyAsString());
View Full Code Here

Examples of org.apache.commons.httpclient.ConnectMethod

                System.getProperty("http.proxyUserName"),
                System.getProperty("http.proxyPassword")));
        }

        if (connection.isProxied() && connection.isSecure()) {
            method = new ConnectMethod(method);
        }
        method.execute(state, connection);

        if (method.getStatusCode() == HttpStatus.SC_OK) {
            System.out.println(method.getResponseBodyAsString());
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.