return;
}
if (path.startsWith("/")) path = path.substring(1);
String[] parts = path.split("/");
Transport transport = config.getTransport(TransportType.from(parts[0]));
if (transport == null) {
if ("GET".equals(request.getMethod()) && "socket.io.js".equals(parts[0])) {
response.setContentType("text/javascript");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("com/glines/socketio/socket.io.js");
OutputStream os = response.getOutputStream();
IO.copy(is, os);
return;
}else if ("GET".equals(request.getMethod()) && "WebSocketMain.swf".equals(parts[0])) {
response.setContentType("application/x-shockwave-flash");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("com/glines/socketio/WebSocketMain.swf");
OutputStream os = response.getOutputStream();
IO.copy(is, os);
return;
} else {
response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unknown SocketIO transport: " + parts[0]);
return;
}
}
if (LOGGER.isLoggable(Level.FINE))
LOGGER.log(Level.FINE, "Handling request from " + request.getRemoteHost() + ":" + request.getRemotePort() + " with transport: " + transport.getType());
transport.handle(request, response, new Transport.InboundFactory() {
@Override
public SocketIOInbound getInbound(HttpServletRequest request) {
return AbstractWaveSocketIOServlet.this.doSocketIOConnect(request);
}
}, sessionManager);