#NEWLINE# def _get_agent( self , request , timeout ) : #NEWLINE# #INDENT# bindaddress = ( request . meta . get ( 'bindaddress' ) or self . _bindAddress ) #NEWLINE# proxy = request . meta . get ( 'proxy' ) #NEWLINE# if proxy : #NEWLINE# #INDENT# ( _ , _ , proxyHost , proxyPort , proxyParams ) = _parse ( proxy ) #NEWLINE# scheme = _parse ( request . url ) [ 0 ] #NEWLINE# proxyHost = to_unicode ( proxyHost ) #NEWLINE# omitConnectTunnel = ( b'noconnect' in omitConnectTunnel ) #NEWLINE# if ( ( scheme == b'https' ) and ( not omitConnectTunnel ) ) : #NEWLINE# #INDENT# proxyConf = ( proxyHost , proxyPort , request . headers . get ( b'Proxy-Authorization' , None ) ) #NEWLINE# return self . _TunnelingAgent ( reactor , proxyConf , contextFactory = self . _contextFactory , connectTimeout = timeout , bindAddress = bindaddress , pool = self . _pool ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# endpoint = TCP4ClientEndpoint ( reactor , proxyHost , proxyPort , timeout = timeout , bindAddress = bindaddress ) #NEWLINE# return self . _ProxyAgent ( endpoint ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _Agent ( reactor , contextFactory = self . _contextFactory , connectTimeout = timeout , bindAddress = bindaddress , pool = self . _pool )