예제 #1
0
    def _setup_transport(self):
        if self._transport is None:
            self._transport = SSLTCPClient(self._host, self._port)
            if self._proxies:
                self._transport = ProxyFactory(self._transport,
                                               self._proxies,
                                               preferred='https')
            self._setup_parser()

        if self._transport.get_property("status") != IoStatus.OPEN:
            self._transport.open()
예제 #2
0
파일: HTTP.py 프로젝트: stlcours/emesene
 def _setup_transport(self):
     if self._transport is None:
         if self._http_proxy:
             self._transport = TCPClient(self._http_proxy.host,
                     self._http_proxy.port)
         else:
             self._transport = TCPClient(self._host, self._port)
             if self._proxies:
                 self._transport = ProxyFactory(self._transport,
                         self._proxies, 'http')
         self._setup_parser()
     
     if self._transport.get_property("status") != IoStatus.OPEN:
         self._transport.open()