Package org.xlightweb.server

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


   
    @Test
    public void testClientAndServerClose() throws Exception {
        HttpServer server = new HttpServer(new MixedRequestHandler());
        server.start();
       
        HttpClient httpClient = new HttpClient();
       
        IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/"));
        Assert.assertEquals(200, response.getStatus());
View Full Code Here


                con.writeMessage(new TextMessage("should not be sent"));
            }
        };
       
        HttpServer server = new HttpServer(hdl);
        server.start();
       
        HttpClient httpClient = new HttpClient();
       
        try {
            httpClient.openWebSocketConnection("ws://localhost:" + server.getLocalPort());
View Full Code Here

   
   
    @Test
    public void testClientAndServerSSL() throws Exception {
        HttpServer server = new HttpServer(0, new MixedRequestHandler(), SSLTestContextFactory.getSSLContext(), true);
        server.start();
       
        HttpClient httpClient = new HttpClient(SSLTestContextFactory.getSSLContext());
       
        IWebSocketConnection webSocketConnection = httpClient.openWebSocketConnection("wss://localhost:" + server.getLocalPort());
       
View Full Code Here

    System.setProperty("org.xlightweb.showDetailedError", "true");
 
    final HttpClient httpClient = new HttpClient();

    final IServer server = new HttpServer(new EchoHandler());
    server.start();

    for (int i = 0; i < 3; i++) {
      Thread t = new Thread() {

        @Override
View Full Code Here

  @Test
  public void testRequestTimeout() throws Exception {
      System.out.println("testRequestTimeout");
     
    IServer server = new HttpServer(new RequestTimeoutServerHandler());
    server.start();
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());

    for (int i = 0; i < 3; i++) {
      QAUtil.sleep(200);
View Full Code Here

    Handler hdl = new Handler()
    HttpServer server = new HttpServer(hdl);
    server.addConnectionHandler(hdl);
    server.setMaxConcurrentConnections(20000);
    server.setTransactionLogMaxSize(1000);
    server.start();

    ConnectionUtils.registerMBean(server);
   
    HttpClient httpClient = new HttpClient();
View Full Code Here

          Handler hdl = new Handler()
          HttpServer server = new HttpServer(hdl);
          server.addConnectionHandler(hdl);
          server.setMaxConcurrentConnections(20000);
          server.setTransactionLogMaxSize(1000);
          server.start();

          ConnectionUtils.registerMBean(server);
         
          HttpClient httpClient = new HttpClient();
View Full Code Here

   
    RequestHandler h2 = new RequestHandler("/bs");
    chain.addLast(h2);

    IHttpServer server = new HttpServer(chain);
    server.start();
   
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
   
    con.write("GET /test HTTP/1.1\r\n" +
View Full Code Here

       
        RequestHandler h2 = new RequestHandler("/bs");
        chain.addLast(h2);

        IHttpServer server = new HttpServer(chain);
        server.start();
       
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
       
       
View Full Code Here

       
        RequestHandler h2 = new RequestHandler("/bs");
        chain.addLast(h2);

        IHttpServer server = new HttpServer(chain);
        server.start();
       
       
        IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
       
        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.