mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
example_httpd.py - demo of I2P-ised Python server classes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
myServerAddress = "mytestxxx.i2p"
|
||||
|
||||
from i2p import BaseHTTPServer, CGIHTTPServer
|
||||
|
||||
class MyServer(BaseHTTPServer.HTTPServer):
|
||||
pass
|
||||
|
||||
class MyRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
|
||||
pass
|
||||
|
||||
def runServer():
|
||||
|
||||
httpd = MyServer(myServerAddress, MyRequestHandler)
|
||||
print "MyServer: local address = %s" % myServerAddress
|
||||
print "MyServer: dest = %s" % httpd.socket.dest
|
||||
httpd.serve_forever()
|
||||
|
||||
if __name__ == '__main__':
|
||||
runServer()
|
||||
|
||||
Reference in New Issue
Block a user