コード例 #1
0
ファイル: http_server.py プロジェクト: mozts2005/OuterSpace
tz_for_log = compute_timezone_for_log()

if __name__ == '__main__':
	import sys
	if len(sys.argv) < 2:
		print 'usage: %s <root> <port>' % (sys.argv[0])
	else:
		import monitor
		import filesys
		import default_handler
		import status_handler
		import ftp_server
		import chat_server
		import resolver
		import logger
		rs = resolver.caching_resolver ('127.0.0.1')
		lg = logger.file_logger (sys.stdout)
		ms = monitor.secure_monitor_server ('fnord', '127.0.0.1', 9999)
		fs = filesys.os_filesystem (sys.argv[1])
		dh = default_handler.default_handler (fs)
		hs = http_server ('', string.atoi (sys.argv[2]), rs, lg)
		hs.install_handler (dh)
		ftp = ftp_server.ftp_server (
			ftp_server.dummy_authorizer(sys.argv[1]),
			port=8021,
			resolver=rs,
			logger_object=lg
			)
		cs = chat_server.chat_server ('', 7777)
		sh = status_handler.status_extension([hs,ms,ftp,cs,rs])
		hs.install_handler (sh)
コード例 #2
0
        return None, None, None

if __name__ == '__main__':
    import sys
    if len(sys.argv) < 2:
        print 'usage: %s <root> <port>' % (sys.argv[0])
    else:
        import monitor
        import filesys
        import default_handler
        import status_handler
        import ftp_server
        import chat_server
        import resolver
        import logger
        rs = resolver.caching_resolver ('127.0.0.1')
        lg = logger.file_logger (sys.stdout)
        ms = monitor.secure_monitor_server ('fnord', '127.0.0.1', 9999)
        fs = filesys.os_filesystem (sys.argv[1])
        dh = default_handler.default_handler (fs)
        hs = http_server ('', string.atoi (sys.argv[2]), rs, lg)
        hs.install_handler (dh)
        ftp = ftp_server.ftp_server (
                ftp_server.dummy_authorizer(sys.argv[1]),
                port=8021,
                resolver=rs,
                logger_object=lg
                )
        cs = chat_server.chat_server ('', 7777)
        sh = status_handler.status_extension([hs,ms,ftp,cs,rs])
        hs.install_handler (sh)
コード例 #3
0
HTTP_PORT		= 8080 # The standard port is 80
# FTP_PORT		= 8021 # The standard port is 21
# CHAT_PORT		= 8888
MONITOR_PORT	= 9999

# ===========================================================================
# Caching DNS Resolver
# ===========================================================================
# The resolver is used to resolve incoming IP address (for logging),
# and also to resolve hostnames for HTTP Proxy requests.  I recommend
# using a nameserver running on the local machine, but you can also
# use a remote nameserver.

# rs = resolver.caching_resolver ('127.0.0.1')
rs = resolver.caching_resolver ('128.115.18.251')

# ===========================================================================
# Logging.
# ===========================================================================

# There are several types of logging objects. Multiple loggers may be combined,
# See 'logger.py' for more details.

# This will log to stdout:
lg = logger.file_logger (sys.stdout)

# This will log to syslog:
#lg = logger.syslog_logger ('/dev/log')

# This will wrap the logger so that it will
コード例 #4
0
ファイル: http_server.py プロジェクト: Brenhilt/M2Crypto
if __name__ == "__main__":
    import sys

    if len(sys.argv) < 2:
        print "usage: %s <root> <port>" % (sys.argv[0])
    else:
        import monitor
        import filesys
        import default_handler
        import status_handler
        import ftp_server
        import chat_server
        import resolver
        import logger

        rs = resolver.caching_resolver("127.0.0.1")
        lg = logger.file_logger(sys.stdout)
        ms = monitor.secure_monitor_server("fnord", "127.0.0.1", 9999)
        fs = filesys.os_filesystem(sys.argv[1])
        dh = default_handler.default_handler(fs)
        hs = http_server("", string.atoi(sys.argv[2]), rs, lg)
        hs.install_handler(dh)
        ftp = ftp_server.ftp_server(ftp_server.dummy_authorizer(sys.argv[1]), port=8021, resolver=rs, logger_object=lg)
        cs = chat_server.chat_server("", 7777)
        sh = status_handler.status_extension([hs, ms, ftp, cs, rs])
        hs.install_handler(sh)
        if "-p" in sys.argv:

            def profile_loop():
                try:
                    asyncore.loop()
コード例 #5
0
ファイル: start_cdms.py プロジェクト: ptbremer/uvcdat-devel
HTTP_PORT = 8080  # The standard port is 80
# FTP_PORT		= 8021 # The standard port is 21
# CHAT_PORT		= 8888
MONITOR_PORT = 9999

# ===========================================================================
# Caching DNS Resolver
# ===========================================================================
# The resolver is used to resolve incoming IP address (for logging),
# and also to resolve hostnames for HTTP Proxy requests.  I recommend
# using a nameserver running on the local machine, but you can also
# use a remote nameserver.

# rs = resolver.caching_resolver ('127.0.0.1')
rs = resolver.caching_resolver('128.115.18.251')

# ===========================================================================
# Logging.
# ===========================================================================

# There are several types of logging objects. Multiple loggers may be combined,
# See 'logger.py' for more details.

# This will log to stdout:
lg = logger.file_logger(sys.stdout)

# This will log to syslog:
#lg = logger.syslog_logger ('/dev/log')

# This will wrap the logger so that it will