forked from I2P_Developers/i2p.i2p
Updated Python I2P version 0.91 by sunshine
This commit is contained in:
26
apps/sam/python/src/examples/cgi_server.py
Normal file
26
apps/sam/python/src/examples/cgi_server.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
# -----------------------------------------------
|
||||
# cgi_server.py: Simple CGI server
|
||||
# -----------------------------------------------
|
||||
|
||||
myServerSession = "mytestxxx.i2p"
|
||||
|
||||
from i2p import BaseHTTPServer, CGIHTTPServer
|
||||
|
||||
class MyServer(BaseHTTPServer.HTTPServer):
|
||||
pass
|
||||
|
||||
class MyRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
|
||||
pass
|
||||
|
||||
def runServer():
|
||||
|
||||
httpd = MyServer(myServerSession, MyRequestHandler)
|
||||
print "MyServer: local SAM session = %s" % myServerSession
|
||||
print "MyServer: dest = %s" % httpd.socket.dest
|
||||
httpd.serve_forever()
|
||||
|
||||
if __name__ == '__main__':
|
||||
runServer()
|
||||
|
||||
Reference in New Issue
Block a user