'Render a request by forwarding it to the proxied server.'

def render(self, request):

    if (self.port == 80):
        host = self.host
    else:
        host = ((self.host + u':') + str(self.port))
    request.requestHeaders.setRawHeaders('host', [host.encode('ascii')])
    request.content.seek(0, 0)
    qs = urllib_parse.urlparse(request.uri)[4]
    if qs:
        rest = ((self.path + '?') + qs)
    else:
        rest = self.path
    clientFactory = self.proxyClientFactoryClass(request.method, rest, request.clientproto, request.getAllHeaders(), request.content.read(), request)
    self.reactor.connectTCP(self.host, self.port, clientFactory)
    return NOT_DONE_YET
