Package org.xlightweb.server

Examples of org.xlightweb.server.HttpServer.start()


                }
            }
        };
       
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test"));
View Full Code Here



    @Test
    public void testServerMixedHandler() throws Exception {
        HttpServer server = new HttpServer(new MixedRequestHandler());
        server.start();

        BlockingConnection bc = new BlockingConnection("localhost", server.getLocalPort());

        bc.write("GET / HTTP/1.1\r\n"+
                 "Host: localhost:" + server.getLocalPort() + "\r\n"+
View Full Code Here

   
    @Test
    public void testServer() throws Exception {
  
        HttpServer server = new HttpServer(new WebHandler());
        server.start();

        BlockingConnection bc = new BlockingConnection("localhost", server.getLocalPort());

        bc.write("GET /0123456 HTTP/1.1\r\n"+
                 "Host: localhost:" + server.getLocalPort() + "\r\n"+
View Full Code Here

    servletEngine.start();


    // start xSocket
    Server server = new HttpServer(0, new CompareParametersHandler());
    server.start();


   
    // compare calls
    callAndCompare(servletEngine.getLocalPort(), server.getLocalPort(), "/test?print=&param2= ");
View Full Code Here

  @Test
  public void testHttp1_1() throws Exception {
    System.out.println("testHttp1_1");
   
    HttpServer server = new HttpServer(new RequestHandler());
    server.start();

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    con.write("GET /test HTTP/1.1\r\n");
    con.write("Host: localhost:" +  server.getLocalPort() + "\r\n");
    con.write("User-Agent:me\r\n");
View Full Code Here

  @Test
  public void testHttp1_0() throws Exception {
    System.out.println("testHttp1_0");
       
    HttpServer server = new HttpServer(new RequestHandler());
    server.start();

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    con.write("GET /test HTTP/1.0\r\n");
    con.write("\r\n");
   
View Full Code Here

            }
        };
       
       
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpRequest request = new GetRequest("http://localhost:" + server.getLocalPort() + "/");
View Full Code Here

            }
        };
       
       
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
        httpClient.setCacheMaxSizeKB(100);
       
        IHttpResponse resp = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
View Full Code Here

                con.writeMessage(msg);
            }
        };
       
        HttpServer server = new HttpServer(8877, echoHandler);
        server.start();
    }
}
View Full Code Here

   

    @Test
    public void testClientAndServer() throws Exception {
        HttpServer server = new HttpServer(new MixedRequestHandler());
        server.start();
        HttpClient httpClient = new HttpClient();
       
        IWebSocketConnection webSocketConnection = httpClient.openWebSocketConnection("ws://localhost:" + server.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.