private void readInitialRequest(HttpRequest req) {
        req = copyRequest(req);

        String hostAndPort = ProxyUtils.getHostAndPort(req);
        if (hostAndPort == null || hostAndPort.isEmpty()) {
            writeBadRequestResponse("Missing hostAndPort in request to: " + req.getUri());
            setCurrentState(DISCONNECTED);
            return;
        }

        if (isConnectRequest(req)) {
            if (outboundHandler != null) {
                writeBadRequestResponse("Can't reuse old connection for tunneling.");
                return;
            }
        }

        if (outboundHandler == null) {
            createOutboundHandler(req, hostAndPort);
            return;
        }

        prepareProxyRequest(req);
        outboundHandler.writeToChannel(req);

        if (req instanceof LastHttpContent) {
            setCurrentState(INITIAL);
        } else {
            setCurrentState(READING_CONTENT);
        }
    }