Package org.browsermob.proxy.jetty.util

Examples of org.browsermob.proxy.jetty.util.InetAddrPort


        //create a stream manager that will be capped to 100 Megabits
        //remember that by default it is disabled!
        streamManager = new StreamManager( 100 * BandwidthLimiter.OneMbps );

        server = new Server();
        HttpListener listener = new SocketListener(new InetAddrPort(getPort()));
        server.addListener(listener);
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        server.addContext(context);

View Full Code Here


        if (port == -1) {
            throw new IllegalStateException("Must set port before starting");
        }

        server = new Server();
        server.addListener(new SocketListener(new InetAddrPort(getPort()))); // todo: arg?
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        server.addContext(context);

        handler = new BrowserMobProxyHandler();
View Full Code Here

    public DummyServer(int port) {
        this.port = port;
    }

    public void start() throws Exception {
        HttpListener listener = new SocketListener(new InetAddrPort(port));
       
        server.addListener(listener);
        addServlet("/jsonrpc/", JsonServlet.class);
        addServlet("/cookie/", SetCookieServlet.class);
        addServlet("/echo/", EchoServlet.class);
View Full Code Here

        //create a stream manager that will be capped to 100 Megabits
        //remember that by default it is disabled!
        streamManager = new StreamManager( 100 * BandwidthLimiter.OneMbps );

        server = new Server();
        HttpListener listener = new SocketListener(new InetAddrPort(getPort()));
        server.addListener(listener);
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        server.addContext(context);

View Full Code Here

    {
        String uri = request.getRequestURI();
       
        context.log("CONNECT: "+uri);
       
        InetAddrPort addrPort=new InetAddrPort(uri);
       
        //if (isForbidden(HttpMessage.__SSL_SCHEME,addrPort.getHost(),addrPort.getPort(),false))
        //{
        //    sendForbid(request,response,uri);
        //}
        //else
        {
            InputStream in=request.getInputStream();
            OutputStream out=response.getOutputStream();
           
            Socket socket = new Socket(addrPort.getInetAddress(),addrPort.getPort());
            context.log("Socket: "+socket);
           
            response.setStatus(200);
            response.setHeader("Connection","close");
            response.flushBuffer();
View Full Code Here

      public void handleConnect(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException {
          URI uri = request.getURI();

          try {
              log.fine("CONNECT: " + uri);
              InetAddrPort addrPort;
              // When logging, we'll attempt to send messages to hosts that don't exist
              if (uri.toString().endsWith(".selenium.doesnotexist:443")) {
                  // so we have to do set the host to be localhost (you can't new up an IAP with a non-existent hostname)
                  addrPort = new InetAddrPort(443);
              } else {
                  addrPort = new InetAddrPort(uri.toString());
              }

              if (isForbidden(HttpMessage.__SSL_SCHEME, addrPort.getHost(), addrPort.getPort(), false)) {
                  sendForbid(request, response, uri);
              } else {
                  HttpConnection http_connection = request.getHttpConnection();
                  http_connection.forceClose();
View Full Code Here

        if (port == -1) {
            throw new IllegalStateException("Must set port before starting");
        }

        server = new Server();
        HttpListener listener = new SocketListener(new InetAddrPort(getPort()));
        server.addListener(listener);
        HttpContext context = new HttpContext();
        context.setContextPath("/");
        server.addContext(context);
View Full Code Here

TOP

Related Classes of org.browsermob.proxy.jetty.util.InetAddrPort

Copyright © 2018 www.massapicom. 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.