#!/usr/bin/env python # Fake ICQ update server by Daniel Seither (post@tiwoc.de) # # Must be run # * as root # * from a directory containing updates.xml and ICQ.zip # created by build_updates_xml.py from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler class ICQRequestHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path == '/cb/icq6/30009/0/updates.xml': self._respond_with_file('updates.xml') elif self.path == '/cb/icq6/30009/ICQ.zip': self._respond_with_file('ICQ.zip') else: self.send_error(404) def _respond_with_file(self, filename): f = open(filename) self.send_response(200) self.end_headers() self.wfile.write(f.read()) f.close() httpd = HTTPServer(('', 80), ICQRequestHandler) httpd.serve_forever()