@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"+
"User-Agent: xLightweb/2.11\r\n"+
"Upgrade: WebSocket\r\n"+
"Connection: Upgrade\r\n"+
"Origin: http://localhost:5161/\r\n"+
"\r\n");
bc.readStringByDelimiter("\r\n\r\n");
byte[] msg1 = bc.readBytesByLength(11);
Assert.assertArrayEquals(new byte[] { 0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x79, 0x6f, 0x75, (byte) 0xFF}, msg1);
bc.close();
server.close();
}