| 108 | return self.realhost is not None |
| 109 | |
| 110 | def open(self): |
| 111 | if self.scheme == 'http': |
| 112 | self.__http = http.client.HTTPConnection(self.host, self.port, |
| 113 | timeout=self.__timeout) |
| 114 | elif self.scheme == 'https': |
| 115 | self.__http = http.client.HTTPSConnection(self.host, self.port, |
| 116 | timeout=self.__timeout, |
| 117 | context=self.context) |
| 118 | if self.using_proxy(): |
| 119 | self.__http.set_tunnel(self.realhost, self.realport, |
| 120 | {"Proxy-Authorization": self.proxy_auth}) |
| 121 | |
| 122 | def close(self): |
| 123 | self.__http.close() |