Exemple #1
0
#fs=filesys.os_filesystem(os.path.abspath(os.curdir))
fs=filesys.os_filesystem('/usr/local/pkg/apache/htdocs')
#fs=filesys.os_filesystem('c:/pkg/jdk130/docs')
dh=default_handler.default_handler(fs)
hs.install_handler(dh)
hss.install_handler(dh)

#class rpc_demo (xmlrpc_handler.xmlrpc_handler):
#    def call (self, method, params):
#        print 'method="%s" params=%s' % (method, params)
#        return "Sure, that works"
#rpch = rpc_demo()
#hs.install_handler(rpch)
#hss.install_handler(rpch)

ph=poison_handler.poison_handler(10)
hs.install_handler(ph)
hss.install_handler(ph)

fauthz = ftp_server.anon_authorizer('/usr/local/pkg/apache/htdocs')
ftps = ftps_server.ftp_tls_server(fauthz, ssl_ctx, port=FTP_PORT)

sh=status_handler.status_extension([hs, hss, ftps])
hs.install_handler(sh)
hss.install_handler(sh)

asyncore.loop()
Rand.save_file('../randpool.dat')

Exemple #2
0
hss = https_server.https_server('', HTTPS_PORT, ssl_ctx)

fs = filesys.os_filesystem(os.path.abspath(os.curdir))
#fs=filesys.os_filesystem('/usr/local/pkg/apache/htdocs')
#fs=filesys.os_filesystem('c:/pkg/jdk130/docs')
dh = default_handler.default_handler(fs)
hs.install_handler(dh)
hss.install_handler(dh)

#class rpc_demo (xmlrpc_handler.xmlrpc_handler):
#    def call (self, method, params):
#        print 'method="%s" params=%s' % (method, params)
#        return "Sure, that works"
#rpch = rpc_demo()
#hs.install_handler(rpch)
#hss.install_handler(rpch)

ph = poison_handler.poison_handler(10)
hs.install_handler(ph)
hss.install_handler(ph)

fauthz = ftp_server.anon_authorizer('/usr/local/pkg/apache/htdocs')
ftps = ftps_server.ftp_tls_server(fauthz, ssl_ctx, port=FTP_PORT)

sh = status_handler.status_extension([hs, hss, ftps])
hs.install_handler(sh)
hss.install_handler(sh)

asyncore.loop()
Rand.save_file('../randpool.dat')
Exemple #3
0
import http_server, script_handler
import basecfg

#--------------------------------------

path = basecfg.basepath+'/browser/http'
#path = '/home/rand/apr/browser/http'

os.chdir(path)
fs = filesys.os_filesystem(path)

dh = default_handler.default_handler(fs)
sh = script_handler.script_handler(fs)

if os.uname()[0] == 'AIX' or len(sys.argv) > 1:
  h = http_server.http_server('', 8080)
else:
  h = http_server.http_server('', 8180)

h.install_handler (dh)
h.install_handler (sh)

authorizer = ftp_server.anon_authorizer (basecfg.baselog)
if os.uname()[0] == 'AIX' or len(sys.argv) > 1:
  fs = ftp_server.ftp_server (authorizer, port=8021)
else:
  fs = ftp_server.ftp_server (authorizer, port=8121)

asyncore.loop()