}
return;
}
CBuffer origURIx = serverHttpReq.requestURI();
// String origURI = origURIx.toString();
// if (origURI.startsWith("http://")) {
// // Real proxy - extract client address, modify the uri.
// // TODO: optimize the strings.
// int start = origURI.indexOf('/', 7);
// String hostPortS = (start == -1) ?
// origURI.subSequence(7, origURI.length()).toString() :
// origURI.subSequence(7, start).toString();
// String[] hostPort = hostPortS.split(":");
//
// dstHost = hostPort[0];
// dstPort = (hostPort.length > 1) ? Integer.parseInt(hostPort[1]) :
// 80;
//
// if (start >= 0) {
// serverHttpReq.requestURI().set(origURI.substring(start));
// } else {
// serverHttpReq.requestURI().set("/");
// }
// } else {
// Adjust the host header.
CBuffer hostHdr =
serverHttpReq.getMimeHeaders().getHeader("host");
if (hostHdr != null) {
hostHdr.recycle();
CBuffer cb = hostHdr;
cb.append(dstHost);
if (dstPort != 80) {
cb.append(':');
cb.appendInt(dstPort);
}
}
// }
if (debug) {
HttpChannel server = serverHttpReq.getHttpChannel();