Package org.xlightweb.server

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


        chain.addLast(interceptor);
        ContinueHandler hdl = new ContinueHandler();
        chain.addLast(hdl);
       
        HttpServer server = new HttpServer(chain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here


        chain.addLast(interceptor);
        ContinueHandler hdl = new ContinueHandler();
        chain.addLast(hdl);
       
        HttpServer server = new HttpServer(chain);
        server.start();
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
        con.write("POST / HTTP/1.1\r\n" +
                  "Host: localhost\r\n" +
                  "User-Agent: me\r\n" +
View Full Code Here

    Context ctx = new Context("");
    ctx.addHandler("/site/*", new FileServiceRequestHandler(basePath, true));
    ctx.addHandler("/rpc/*", new MyBusinessHandler());
   
    Server server = new HttpServer(ctx);
    server.start();
   
   
    HttpClient httpClient = new HttpClient();
   
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/site/" + testFile.getName()));
View Full Code Here

    Context ctx = new Context("");
    ctx.addHandler("/site/*", new FileServiceRequestHandler(basePath, true));
    ctx.addHandler(new AnnotatedHandler());
   
    Server server = new HttpServer(ctx);
    server.start();
   
   
    HttpClient httpClient = new HttpClient();
   
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/site/" + testFile.getName()));
View Full Code Here

      Context rootCtx = new Context("");
      rootCtx.addHandler(new PersonRequestHandler());
      rootCtx.addHandler(new AccountRequestHandler());

      IServer server = new HttpServer(port, rootCtx);
      server.start();

      HttpClient httpClient = new HttpClient()
     
      IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort()+ "/Person/1"));
      Assert.assertEquals(200, response.getStatus());
View Full Code Here

    Assert.assertEquals(2, ctx.size());
 

   
    Server server = new HttpServer(ctx);
    server.start();
   
   
    HttpClient httpClient = new HttpClient();
   
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test"));
View Full Code Here

   
   
    Context ctx = new Context("/ctx1");
    ctx.addHandler("/test/*", new TestRequestHandler());
    HttpServer server = new HttpServer(ctx);
    server.start();
   
   
    HttpClient httpClient = new HttpClient();
   
    IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + jettyServer.getConnectors()[0].getLocalPort() + "/ctx1/test/you"));
View Full Code Here

    // start xSocket
    Context ctx = new Context("");
    ctx.addHandler("/ctx1/*", hdl);
    Server server = new HttpServer(ctx);
    server.start();
   
   
    GetRequest req = new GetRequest("http://localhost:" + server.getLocalPort() + "/ctx1/test/test2");
    req.setHeader("Host", "localhost");
    req.setHeader("User-Agent", "me");
View Full Code Here

    // start xSocket
    Context ctx = new Context("");
    ctx.addHandler("/ctx1/*", hdl);
    HttpServer server = new HttpServer(ctx);
    server.addConnectionHandler(hdl);
    server.start();
   
   
    GetRequest req = new GetRequest("http://localhost:" + server.getLocalPort() + "/ctx1/test/test2");
    req.setHeader("Host", "localhost");
    req.setHeader("User-Agent", "me");
View Full Code Here

    ctx.addHandler("/ctx1/*", hdl);
    HttpServer server = new HttpServer(ctx);
   
    server.setRequestTimeoutMillis(1000);
   
    server.start();
   
   
   
    IBlockingConnection con = new BlockingConnection("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.