ip=IP_ADDRESS, port=FTP_PORT, resolver=rs, logger_object=lg ) # =========================================================================== # Monitor Server: # =========================================================================== # This creates a secure monitor server, binding to the loopback # address on port 9999, with password 'fnord'. The monitor server # can be used to examine and control the server while it is running. # If you wish to access the server from another machine, you will # need to use '' or some other IP instead of '127.0.0.1'. ms = monitor.secure_monitor_server ('fnord', '127.0.0.1', MONITOR_PORT) # =========================================================================== # Chat Server # =========================================================================== # The chat server is a simple IRC-like server: It is meant as a # demonstration of how to write new servers and plug them into medusa. # It's a very simple server (it took about 2 hours to write), but it # could be easily extended. For example, it could be integrated with # the web server, perhaps providing navigational tools to browse # through a series of discussion groups, listing the number of current # users, authentication, etc... cs = chat_server.chat_server (IP_ADDRESS, CHAT_PORT)
return None, None, None if __name__ == '__main__': if len(sys.argv) < 2: print('usage: %s <root> <port>' % (sys.argv[0])) else: import supervisor.medusa.monitor as monitor import supervisor.medusa.filesys as filesys import supervisor.medusa.default_handler as default_handler import supervisor.medusa.ftp_server as ftp_server import supervisor.medusa.chat_server as chat_server import supervisor.medusa.resolver as resolver 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('', int(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) if '-p' in sys.argv: def profile_loop(): try: asyncore.loop() except KeyboardInterrupt:
ftp = ftp_server.ftp_server(ftp_server.anon_authorizer(PUBLISHING_ROOT), ip=IP_ADDRESS, port=FTP_PORT, resolver=rs, logger_object=lg) # =========================================================================== # Monitor Server: # =========================================================================== # This creates a secure monitor server, binding to the loopback # address on port 9999, with password 'fnord'. The monitor server # can be used to examine and control the server while it is running. # If you wish to access the server from another machine, you will # need to use '' or some other IP instead of '127.0.0.1'. ms = monitor.secure_monitor_server('fnord', '127.0.0.1', MONITOR_PORT) # =========================================================================== # Chat Server # =========================================================================== # The chat server is a simple IRC-like server: It is meant as a # demonstration of how to write new servers and plug them into medusa. # It's a very simple server (it took about 2 hours to write), but it # could be easily extended. For example, it could be integrated with # the web server, perhaps providing navigational tools to browse # through a series of discussion groups, listing the number of current # users, authentication, etc... cs = chat_server.chat_server(IP_ADDRESS, CHAT_PORT)
if __name__ == '__main__': import sys if len(sys.argv) < 2: print('usage: %s <root> <port>' % (sys.argv[0])) else: import supervisor.medusa.monitor as monitor import supervisor.medusa.filesys as filesys import supervisor.medusa.default_handler as default_handler import supervisor.medusa.status_handler as status_handler import supervisor.medusa.ftp_server as ftp_server import supervisor.medusa.chat_server as chat_server import supervisor.medusa.resolver as resolver import supervisor.medusa.logger as 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 ('', int(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 ():
# 'write-capable' commands are unavailable] ftp = ftp_server.ftp_server( ftp_server.anon_authorizer(PUBLISHING_ROOT), ip=IP_ADDRESS, port=FTP_PORT, resolver=rs, logger_object=lg ) # =========================================================================== # Monitor Server: # =========================================================================== # This creates a secure monitor server, binding to the loopback # address on port 9999, with password 'fnord'. The monitor server # can be used to examine and control the server while it is running. # If you wish to access the server from another machine, you will # need to use '' or some other IP instead of '127.0.0.1'. ms = monitor.secure_monitor_server("fnord", "127.0.0.1", MONITOR_PORT) # =========================================================================== # Chat Server # =========================================================================== # The chat server is a simple IRC-like server: It is meant as a # demonstration of how to write new servers and plug them into medusa. # It's a very simple server (it took about 2 hours to write), but it # could be easily extended. For example, it could be integrated with # the web server, perhaps providing navigational tools to browse # through a series of discussion groups, listing the number of current # users, authentication, etc... cs = chat_server.chat_server(IP_ADDRESS, CHAT_PORT)
if __name__ == "__main__": if len(sys.argv) < 2: print("usage: %s <root> <port>" % (sys.argv[0])) else: import supervisor.medusa.monitor as monitor import supervisor.medusa.filesys as filesys import supervisor.medusa.default_handler as default_handler import supervisor.medusa.ftp_server as ftp_server import supervisor.medusa.chat_server as chat_server import supervisor.medusa.resolver as resolver 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("", int(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) if "-p" in sys.argv: def profile_loop(): try: asyncore.loop() except KeyboardInterrupt: pass import profile