def _post_open(self): AbstractProxy._post_open(self) proxy_protocol = 'CONNECT %s:%s HTTP/1.1\r\n' % (self.host, self.port) proxy_protocol += 'Proxy-Connection: Keep-Alive\r\n' proxy_protocol += 'Pragma: no-cache\r\n' proxy_protocol += 'User-Agent: %s/%s\r\n' % (GNet.NAME, GNet.VERSION) if self._proxy.user: auth = base64.encodestring(self._proxy.user + ':' + self._proxy.password).strip() proxy_protocol += 'Proxy-authorization: Basic ' + auth + '\r\n' proxy_protocol += '\r\n' self._http_parser.enable() self._transport.send(proxy_protocol)
def _post_open(self): AbstractProxy._post_open(self) user = self._proxy.user proxy_protocol = struct.pack('!BBH', SOCKS4Proxy.PROTOCOL_VERSION, SOCKS4Proxy.CONNECT_COMMAND, self.port) for part in self.host.split('.'): proxy_protocol += struct.pack('B', int(part)) proxy_protocol += user proxy_protocol += struct.pack('B', 0) self._delimiter_parser.enable() self._transport.send(proxy_protocol)
def _post_open(self): AbstractProxy._post_open(self) host = self._client.get_property("host") port = self._client.get_property("port") user = self._proxy.user proxy_protocol = struct.pack('!BBH', SOCKS4Proxy.PROTOCOL_VERSION, SOCKS4Proxy.CONNECT_COMMAND, port) for part in host.split('.'): proxy_protocol += struct.pack('B', int(part)) proxy_protocol += user proxy_protocol += struct.pack('B', 0) self._transport.send(proxy_protocol)
def _post_open(self): AbstractProxy._post_open(self) self._delimiter_parser.enable() self._send_nego_msg()