(self, cc, scheme, host, port, sni)
return self.server_conn
When SNI is in play, this means we have an SSL-encrypted
            connection, which means that the entire handler is dedicated to a
            single server connection - no multiplexing. If this assumption ever
            breaks, we'll have to do something different with the SNI host
            variable on the handler object.
When SNI is in play, this means we have an SSL-encrypted
            connection, which means that the entire handler is dedicated to a
            single server connection - no multiplexing. If this assumption ever
            breaks, we'll have to do something different with the SNI host
            variable on the handler object.
When SNI is in play this means we have an SSL - encrypted connection which means that the entire handler is dedicated to a single server connection - no multiplexing . If this assumption ever breaks we ll have to do something different with the SNI host variable on the handler object .
def get_server_connection(self, cc, scheme, host, port, sni):
        """
            When SNI is in play, this means we have an SSL-encrypted
            connection, which means that the entire handler is dedicated to a
            single server connection - no multiplexing. If this assumption ever
            breaks, we'll have to do something different with the SNI host
            variable on the handler object.
        """
        sc = self.server_conn
        if not sni:
            sni = host
        if sc and (scheme, host, port, sni) != (sc.scheme, sc.host, sc.port, sc.sni):
            sc.terminate()
            self.server_conn = None
            self.log(
                cc,
                "switching connection", [
                    "%s://%s:%s (sni=%s) -> %s://%s:%s (sni=%s)"%(
                        scheme, host, port, sni,
                        sc.scheme, sc.host, sc.port, sc.sni
                    )
                ]
            )
        if not self.server_conn:
            try:
                self.server_conn = ServerConnection(self.config, scheme, host, port, sni)
                self.server_conn.connect()
            except tcp.NetLibError, v:
                raise ProxyError(502, v)
        return self.server_conn
def get_server_connection ( self , cc , scheme , host , port , sni ) : sc = self . server_conn if not sni : sni = host if sc and ( scheme , host , port , sni ) != ( sc . scheme , sc . host , sc . port , sc . sni ) : sc . terminate ( ) self . server_conn = None self . log ( cc , "switching connection" , [ "%s://%s:%s (sni=%s) -> %s://%s:%s (sni=%s)" % ( scheme , host , port , sni , sc . scheme , sc . host , sc . port , sc . sni ) ] ) if not self . server_conn : try : self . server_conn = ServerConnection ( self . config , scheme , host , port , sni ) self . server_conn . connect ( ) except tcp . NetLibError , v : raise ProxyError ( 502 , v ) return self . server_conn