'override socket.socket.sendall method to rewrite the header
for non-tunneling proxies if needed'

def sendall(self, content, *args):

    if (not self.__httptunnel):
        content = self.__rewriteproxy(content)
    return super(socksocket, self).sendall(content, *args)
