diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-26 12:00:26 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-26 12:00:26 +0000 |
commit | 117335dc011ddbfb08bc71391c2dadf6ba28c4bf (patch) | |
tree | 9e1b9543c8a48e36b68f32847be1029fb879289c /src/gns/proxy | |
parent | 5b1d9bab0e4f4ea3b578f1a237d6e842f2dd250e (diff) | |
download | gnunet-117335dc011ddbfb08bc71391c2dadf6ba28c4bf.tar.gz gnunet-117335dc011ddbfb08bc71391c2dadf6ba28c4bf.zip |
-add leho to proxy
Diffstat (limited to 'src/gns/proxy')
-rw-r--r-- | src/gns/proxy/proxy.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gns/proxy/proxy.py b/src/gns/proxy/proxy.py index 468256a11..eca2e43d2 100644 --- a/src/gns/proxy/proxy.py +++ b/src/gns/proxy/proxy.py | |||
@@ -109,6 +109,16 @@ class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler): | |||
109 | self.command, | 109 | self.command, |
110 | urlparse.urlunparse(('', '', path, params, query, '')), | 110 | urlparse.urlunparse(('', '', path, params, query, '')), |
111 | self.request_version)) | 111 | self.request_version)) |
112 | if (re.match("(\w+\.)*gnunet", self.headers['Host'])): | ||
113 | leho = os.popen("gnunet-gns -t LEHO -u "+self.headers['Host']).readlines() | ||
114 | if (len(leho) < 2): | ||
115 | print "Legacy hostname lookup failed!" | ||
116 | elif (len(leho) == 1): | ||
117 | print "Legacy hostname not present!" | ||
118 | else: | ||
119 | newhost = leho[1].split(" ")[-1].rstrip() | ||
120 | print "Changing Host: "+self.headers['Host']+" to "+newhost | ||
121 | self.headers['Host'] = newhost | ||
112 | self.headers['Connection'] = 'close' | 122 | self.headers['Connection'] = 'close' |
113 | del self.headers['Proxy-Connection'] | 123 | del self.headers['Proxy-Connection'] |
114 | for key_val in self.headers.items(): | 124 | for key_val in self.headers.items(): |