//auxiliary method to print messages
private void printMessage(String prefix, MessageEvent e) {
Object msgO = e.getMessage();
String resp;
if(msgO instanceof HttpRequest) {
HttpRequest msgReq = (HttpRequest)msgO;
//Matcher result = pattern.matcher(msgReq.getUri());
resp = msgReq.getUri();
} else if(msgO instanceof HttpResponse){
HttpResponse msgReq = (HttpResponse)msgO;
resp = msgReq.toString();
} else if(msgO instanceof HttpChunk){
HttpChunk msgReq = (HttpChunk)msgO;
resp = msgReq.toString();
} else {
ChannelBuffer msg = (ChannelBuffer)msgO;
byte[] bytes = new byte[msg.capacity()];
msg.readBytes(bytes);
msg.setIndex(0, bytes.length);