Examples of ProxyConfig


Examples of com.gargoylesoftware.htmlunit.ProxyConfig

    proxyConfig = new ProxyConfig(host, port);
    webClient.setProxyConfig(proxyConfig);
  }
 
  public void setAutoProxy(String autoProxyUrl) {
    proxyConfig = new ProxyConfig();
    proxyConfig.setProxyAutoConfigUrl(autoProxyUrl);
    webClient.setProxyConfig(proxyConfig);
  }
View Full Code Here

Examples of com.github.dreamhead.moco.handler.proxy.ProxyConfig

    public HttpResponseSetting proxy(final ProxyConfig config) {
        return proxy(checkNotNull(config, "Proxy config should not be null"), Failover.DEFAULT_FAILOVER);
    }

    public HttpResponseSetting proxy(final ProxyConfig proxyConfig, final Failover failover) {
        ProxyConfig config = checkNotNull(proxyConfig, "Proxy config should not be null");
        this.request(InternalApis.context(config.localBase())).response(Moco.proxy(config, checkNotNull(failover, "Failover should not be null")));
        return this;
    }
View Full Code Here

Examples of com.teamdev.jxbrowser.proxy.ProxyConfig

  private static boolean proxyAuthenticationInitialized = false;

  public static void updateJXBrowserProxy()
  {
    ProxyConfig proxyConf = BrowserServices.getInstance().getProxyConfig();
    if( proxyConf == null )
      return;

    try
    {
      proxyConf.setAutoDetectForNetwork( false );

      if( !proxyAuthenticationInitialized )
      {
        proxyConf.setAuthenticationHandler( ServerType.HTTP, new AuthenticationHandler()
        {
          @Override
          public ProxyServerLogin authenticationRequired( ServerType arg0 )
          {
            Settings settings = SoapUI.getSettings();
            PropertyExpansionContext context = null;

            String proxyUsername = PropertyExpander.expandProperties( context,
                settings.getString( ProxySettings.USERNAME, null ) );
            String proxyPassword = PropertyExpander.expandProperties( context,
                settings.getString( ProxySettings.PASSWORD, null ) );

            return new ProxyServerLogin( proxyUsername, proxyPassword );
          }
        } );

        proxyAuthenticationInitialized = true;
      }

      if( ProxyUtils.isProxyEnabled() )
      {
        Settings settings = SoapUI.getSettings();
        PropertyExpansionContext context = null;

        // check system properties first
        String proxyHost = System.getProperty( "http.proxyHost" );
        String proxyPort = System.getProperty( "http.proxyPort" );

        if( proxyHost == null )
          proxyHost = PropertyExpander.expandProperties( context, settings.getString( ProxySettings.HOST, "" ) );

        if( proxyPort == null )
          proxyPort = PropertyExpander.expandProperties( context, settings.getString( ProxySettings.PORT, "" ) );

        proxyConf.setProxy( ServerType.HTTP, new ProxyServer( proxyHost, Integer.parseInt( proxyPort ) ) );
        // check excludes
        proxyConf.setExceptions( PropertyExpander.expandProperties( context,
            settings.getString( ProxySettings.EXCLUDES, "" ) ) );
      }
      else
      {
        proxyConf.setDirectConnection();
      }
    }
    catch( Throwable e )
    {
    }
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    // given
    CustomProxySelector customProxySelector = new CustomProxySelector(defaultProxySelectorMock, config);

    when(config.hasProxyConfigForHost("my.proxified.host.com")).thenReturn(true);
    when(config.getProxyConfigForHost("my.proxified.host.com")).thenReturn(
      new ProxyConfig("proxyhost", "1030", "http",
        new HashSet(asList("my.proxified.host.com"))));

    when(config.hasProxyConfigForHost("my.proxified.host2.com")).thenReturn(true);
    when(config.getProxyConfigForHost("my.proxified.host2.com")).thenReturn(
      new ProxyConfig("proxyhost2", "1040",
        "socks",
        new HashSet(asList("my.proxified.host2.com"))));

    // when
    List<Proxy> proxiesForProxifiedHost = customProxySelector.select(URI.create("some://my.proxified.host.com:5040"));
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    }

  }

  private List<Proxy> getCustomProxyFor(URI uri) {
    ProxyConfig proxyConfig = config.getProxyConfigForHost(uri.getHost());
    return asList(proxyConfig.toJavaProxy());
  }
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

        String proxyHostname = trim(properties.getProperty(hostnameProperty));
        String proxyPort = trim(properties.getProperty(portProperty));
        String proxyType = trim(properties.getProperty(typeProperty));
        Set<String> proxyProxifiedHosts = parseProxifiedHosts(properties.getProperty(proxifiedHostsProperty));

        validProxies.add(new ProxyConfig(proxyHostname, proxyPort, proxyType, proxyProxifiedHosts));
      }
    }

    getLogger().debug(getClass().getSimpleName() + " - discovered following valid proxies: " + validProxies);
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(2));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(customProxies, hasItem(new ProxyConfig("192.168.1.200", "7070", "socks", EMPTY_SET)));

  }
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining port for custom proxy: myProxy2"));

  }
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining type for custom proxy: myProxy2"));

  }
View Full Code Here

Examples of net.sf.jproxyloader.config.ProxyConfig

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining hostname for custom proxy: myProxy2"));

  }
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.