--- proxy.py 2012-02-29 12:18:45.325986699 +0100 +++ Download/proxy.py 2012-02-29 11:29:16.532743821 +0100 @@ -20,7 +20,6 @@ server_version = "TinyHTTPProxy/" + __version__ rbufsize = 0 # self.rfile Be unbuffered - host_port = () def handle(self): (ip, port) = self.client_address @@ -33,11 +32,11 @@ def _connect_to(self, netloc, soc): i = netloc.find(':') if i >= 0: - self.host_port = netloc[:i], int(netloc[i+1:]) + host_port = netloc[:i], int(netloc[i+1:]) else: - self.host_port = netloc, 80 - print "\t" "connect to %s:%d" % self.host_port - try: soc.connect(self.host_port) + host_port = netloc, 80 + print "\t" "connect to %s:%d" % host_port + try: soc.connect(host_port) except socket.error, arg: try: msg = arg[1] except: msg = arg @@ -103,9 +102,8 @@ out = soc data = i.recv(8192) if data: - if (re.match("(\w+\.)*gnunet", self.host_port[0])): - data = re.sub(r'(a href="http://(\w+\.)*)(\+)', r'\1'+self.host_port[0], data) - print data + data = re.sub(r'(a href="http://(\w+\.)*)(\+)', + r'\1gnunet', data) out.send(data) count = 0 else: