| 127 | |
| 128 | |
| 129 | class HTTPSServer(HTTPServer): |
| 130 | port = 12345 |
| 131 | |
| 132 | def __init__(self): |
| 133 | if not hasattr(self, '_map'): |
| 134 | HTTPServer.__init__(self) |
| 135 | |
| 136 | def handle_accept(self): |
| 137 | pair = self.accept() |
| 138 | if pair is not None: |
| 139 | sock, addr = pair |
| 140 | # print 'Incoming connection from %s' % repr(addr) |
| 141 | self.connections += 1 |
| 142 | # if self.connections % 1000 == 0: |
| 143 | # print "Processed %i connections, active %i" % (self.connections, len(asyncore.socket_map)) |
| 144 | HTTPSRequestHandler(sock) |
| 145 | |
| 146 | if __name__ == "__main__": |
| 147 | client = HTTPSServer() |