Package org.xlightweb.server

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


                exchange.send(resp);
            }
        };
       
        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


                exchange.send(resp);
            }
        };
       
        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

    @Test
    public void testSimple() throws Exception {
       
        RequestHandler reqHdl = new RequestHandler();
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
       
        FutureResponseHandler respHdl = new FutureResponseHandler();
        BodyDataSink dataSink = con.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/"), respHdl);
View Full Code Here

    @Test
    public void testFile() throws Exception {
       
        RequestHandler reqHdl = new RequestHandler();
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
       
        File file = QAUtil.createTestfile_4k();
       
View Full Code Here

    @Test
    public void testFile2() throws Exception {
       
        RequestHandler2 reqHdl = new RequestHandler2();
        HttpServer server = new HttpServer(reqHdl);
        server.start();
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
       
        File file = QAUtil.createTestfile_4k();
       
View Full Code Here

  @Test
  public void testMultipleCookies() throws Exception {
   
    HttpServer server = new HttpServer(new RequestHandler());
    server.start();
   
    HttpClient httpClient = new HttpClient();
    httpClient.setAutoHandleCookies(true);
   
    IHttpRequest req = new GetRequest("http://localhost:" + server.getLocalPort() + "/");
View Full Code Here

    @Test
    public void testReturnOnHeader() throws Exception {

        RequestHandler hdl = new RequestHandler();
        HttpServer server = new HttpServer(hdl);
        server.start();

        HttpClient httpClient = new HttpClient();
       
        long start = System.currentTimeMillis();
        IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?delay=2000"));
View Full Code Here

    @Test
    public void testReturnOnMessage() throws Exception {

        RequestHandler hdl = new RequestHandler();
        HttpServer server = new HttpServer(hdl);
        server.start();

        HttpClient httpClient = new HttpClient();
        httpClient.setCallReturnOnMessage(true);
       
        long start = System.currentTimeMillis();
View Full Code Here

   
    RequestHandler h2 = new RequestHandler();
    root.addLast(h2);
   
    IServer server = new HttpServer(root);
    server.start();
   
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());

    con.write("GET / HTTP/1.1\r\n" +
View Full Code Here

   
    NonThreadedRequestHandler h2 = new NonThreadedRequestHandler();
    root.addLast(h2);
   
    IServer server = new HttpServer(root);
    server.start();
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());

    con.write("GET / HTTP/1.1\r\n" +
          "Host: localhost\r\n" +
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.