#!coding=UTF-8
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler
import shutil,io
import timeit
import string,cgi,time
from os import curdir, sep
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
import SocketServer
import socket
class MyHTTPServer(HTTPServer):
allow_reuse_address = True
def server_bind(self):
"""Override server_bind to store the server name."""
allow_reuse_address = True
SocketServer.TCPServer.server_bind(self)
host, port = self.socket.getsockname()[:2]
self.server_name = socket.getfqdn(host)
self.server_port = port
pass
class MyThreadingHTTPServer(SocketServer.ThreadingMixIn, MyHTTPServer):
pass
.....
os.chdir(webdir)
httpd = MyThreadingHTTPServer((httpListenAddr, httpListenPort), OmiHttpHandler.OmiHttpHandler)
阅读(1410) | 评论(0) | 转发(0) |