示例#1
0
def make_plugin(config):
    ident_config = IdentConfig(config)

    p = Plugin()
    factory = Factory()
    factory.protocol = IdentProtocol
    factory.user = ident_config.user

    p.add_service(internet.TCPServer(ident_config.port, factory))

    return p
示例#2
0
def make_plugin(config):
    http_config = HttpConfig(config)

    root = resource.Resource()
    harold = resource.Resource()
    root.putChild('harold', harold)
    site = server.Site(root)
    site.displayTracebacks = False

    plugin = Plugin()
    plugin.root = harold
    plugin.secret = http_config.secret
    plugin.add_service(internet.TCPServer(http_config.port, site))
    return plugin