Examples of ProxySelectorRoutePlanner


Examples of org.apache.http.impl.conn.ProxySelectorRoutePlanner

   @Provides
   @Singleton
   HttpClient newDefaultHttpClient(ProxyConfig config, BasicHttpParams params, ClientConnectionManager cm) {
      DefaultHttpClient client = new DefaultHttpClient(cm, params);
      if (config.useSystem()) {
         ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(client.getConnectionManager()
                  .getSchemeRegistry(), ProxySelector.getDefault());
         client.setRoutePlanner(routePlanner);
      }
      return client;
   }
View Full Code Here

Examples of org.apache.http.impl.conn.ProxySelectorRoutePlanner

        localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);

        DefaultHttpClient httpclient = new DefaultHttpClient();
        /* Configuració del proxy */
        // S'indica que agafi el proxy per defecte indicat a la JRE
        ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
                httpclient.getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault())
        httpclient.setRoutePlanner(routePlanner);
        HttpGet httpget = new HttpGet(uri);
        httpget.setHeader("User-Agent", CoreConstants.UPDATE_DEFAULT_USER_AGENT);
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.