Examples of SimpleProxy


Examples of com.jbidwatcher.util.webserver.SimpleProxy

    }

    //  Enable the internal server, if it's set.
    if(JConfig.queryConfiguration("server.enabled", "false").equals("true")) {
      if(sp == null) {
        sp = new SimpleProxy(localServer_port, com.jbidwatcher.app.JBidProxy.class, null);
      }

      sp.go();
      mServiceAdvertiser = new SyncService(localServer_port);
      mServiceAdvertiser.advertise();
View Full Code Here

Examples of com.jbidwatcher.util.webserver.SimpleProxy

  }

  private void spawnServer() {
    int listenPort = 9099;
    if(mPortNumber != null) listenPort = Integer.parseInt(mPortNumber);
    mServer = new SimpleProxy(listenPort, MiniServer.class, this);
    mServer.go();
    try { mServer.join(); } catch(Exception ignored) { /* Time to die... */ }
  }
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

                this.server.getLocalAddress(),
                this.server.getLocalPort(),
                testhttp);
       
        if (this.useProxy) {
            this.proxy = new SimpleProxy();
            client.getHostConfiguration().setProxy(
                proxy.getLocalAddress(),
                proxy.getLocalPort());               
        }
    }
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

        TARGET_HOST = System.getProperty("httpclient.test.localHost", "localhost");
        TARGET_PORT = Integer.parseInt(System.getProperty("httpclient.test.localPort", "8080"));
    }

    public void testSimpleGet() throws Exception {
        SimpleProxy proxy = new SimpleProxy();

        HttpClient client = new HttpClient();
        HostConfiguration hc = new HostConfiguration();
        hc.setHost(TARGET_HOST, TARGET_PORT, Protocol.getProtocol("http"));
        hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
        client.setHostConfiguration(hc);

        GetMethod get = new GetMethod("/");
        client.executeMethod(get);
        assertEquals(200, get.getStatusCode());
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

        get.releaseConnection();
    }

    public void testAuthGet() throws Exception {
        Credentials creds = new UsernamePasswordCredentials("user", "password");
        SimpleProxy proxy = new SimpleProxy();
        proxy.requireCredentials(creds);

        HttpClient client = new HttpClient();
        HostConfiguration hc = new HostConfiguration();
        hc.setHost(TARGET_HOST, TARGET_PORT, Protocol.getProtocol("http"));
        hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
        client.setHostConfiguration(hc);
        client.getState().setProxyCredentials(AuthScope.ANY, creds);

        GetMethod get = new GetMethod("/");
        client.executeMethod(get);
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

        this.client.getHostConfiguration().setHost(
            this.server.getLocalAddress(),
            this.server.getLocalPort(),
            Protocol.getProtocol("http"));
        if (useProxy) {
            this.proxy = new SimpleProxy();
            client.getHostConfiguration().setProxy(
                proxy.getLocalAddress(),
                proxy.getLocalPort());               
        }
    }
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

    }

    protected void setUp() throws Exception {
        super.setUp();
        this.httpclient = new HttpClient();
        this.proxy = new SimpleProxy();
        this.httpclient.getHostConfiguration().setProxy(
                this.proxy.getLocalAddress(),
                this.proxy.getLocalPort());

        SimpleSocketFactory serversocketfactory = null;
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

    System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");
    */
  }
 
  public void testSimpleGet() throws Exception {
    SimpleProxy proxy = new SimpleProxy();
   
    HttpClient client = new HttpClient();
    HostConfiguration hc = new HostConfiguration();
    hc.setHost("localhost", 8080, Protocol.getProtocol("http"));
    hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
    client.setHostConfiguration(hc);
   
    GetMethod get = new GetMethod("/");
    client.executeMethod(get);
    assertEquals(200, get.getStatusCode());
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

    get.releaseConnection();
  }
 
  public void testAuthGet() throws Exception {
    Credentials creds = new UsernamePasswordCredentials("user", "password");
    SimpleProxy proxy = new SimpleProxy();
    proxy.requireCredentials(creds);
   
    HttpClient client = new HttpClient();
    HostConfiguration hc = new HostConfiguration();
    hc.setHost("localhost", 8080, Protocol.getProtocol("http"));
    hc.setProxy(proxy.getLocalAddress(), proxy.getLocalPort());
    client.setHostConfiguration(hc);
    client.getState().setProxyCredentials(null, null, creds);
   
    GetMethod get = new GetMethod("/");
    client.executeMethod(get);
View Full Code Here

Examples of org.apache.commons.httpclient.server.SimpleProxy

        this.client.getHostConfiguration().setHost(
            this.server.getLocalAddress(),
            this.server.getLocalPort(),
            Protocol.getProtocol("http"));
        if (useProxy) {
            this.proxy = new SimpleProxy();
            client.getHostConfiguration().setProxy(
                proxy.getLocalAddress(),
                proxy.getLocalPort());               
        }
    }
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.