コード例 #1
0
def start():
    """Setup HTTP/WS server. **MUST** be called prior to any operation."""
    auth.ReCaptcha.init()
    application = tornado.web.Application([
            # FIXME daltonism workaround, should be implemented client-side
            (r'/(?:|blind)', handlers.HomePageHandler),
            (r'/log', handlers.LogPageHandler),
            (r'/status', handlers.StatusPageHandler),
            (r'/data', handlers.DataPageHandler),
            (r'/presence', handlers.PresenceForecastHandler),
            (r'/(info)', handlers.MarkdownPageHandler),
            (r'/ws', handlers.StatusHandler),
            (r'/login', handlers.LoginPageHandler),
            (r'/logout', handlers.LogoutPageHandler),
            (r'/admin', handlers.AdminPageHandler),
            (r'/message', handlers.MessagePageHandler),
            (r'/data.php', handlers.RTCHandler),
            (r'/macupdate', handlers.MACUpdateHandler),
        ],
        ui_modules=uimodules,
        gzip=True,
        debug=options.developer_mode,
        static_path=options.assets_path,
        xsrf_cookies=True,
        cookie_secret=options.cookie_secret
    )
    server = tornado.httpserver.HTTPServer(application, xheaders=options.reverse_proxied)
    LOG.info('Starting HTTP/WS server...')
    bind(server, options.web_port, options.web_usocket)
コード例 #2
0
def start():
    """Setup HTTP/WS server. **MUST** be called prior to any operation."""
    StatusRouter = SockJSRouter(handlers.StatusConnection, "/data")

    application = tornado.web.Application(
        [
            # FIXME daltonism workaround, should be implemented client-side
            (r'/(?:|blind)', handlers.HomePageHandler),
            (r'/log', handlers.LogPageHandler),
            (r'/status', handlers.StatusPageHandler),
            (r'/presence', handlers.PresenceForecastHandler),
            (r'/(info)', handlers.MarkdownPageHandler),
            (r'/login', handlers.LoginPageHandler),
            (r'/logout', handlers.LogoutPageHandler),
            (r'/admin', handlers.AdminPageHandler),
            (r'/message', handlers.MessagePageHandler),
            (r'/data.php', handlers.RTCHandler)
        ] + StatusRouter.urls,
        ui_modules=uimodules,
        gzip=True,
        debug=options.developer_mode,
        static_path=options.assets_path,
        xsrf_cookies=True,
        cookie_secret=options.cookie_secret)
    server = tornado.httpserver.HTTPServer(application)  #TODO other options
    LOG.info('Starting HTTP/WS server...')
    bind(server, options.web_port, options.web_usocket)
コード例 #3
0
ファイル: __init__.py プロジェクト: thypon/bits-server
def start():
    """Setup HTTP/WS server. **MUST** be called prior to any operation."""
    StatusRouter = SockJSRouter(handlers.StatusConnection, "/data")

    application = tornado.web.Application([
            # FIXME daltonism workaround, should be implemented client-side
            (r'/(?:|blind)', handlers.HomePageHandler),
            (r'/log', handlers.LogPageHandler),
            (r'/status', handlers.StatusPageHandler),
            (r'/presence', handlers.PresenceForecastHandler),
            (r'/(info)', handlers.MarkdownPageHandler),
            (r'/login', handlers.LoginPageHandler),
            (r'/logout', handlers.LogoutPageHandler),
            (r'/admin', handlers.AdminPageHandler),
            (r'/message', handlers.MessagePageHandler),
            (r'/data.php', handlers.RTCHandler)
        ] + StatusRouter.urls,
        ui_modules=uimodules,
        gzip=True,
        debug=options.developer_mode,
        static_path=options.assets_path,
        xsrf_cookies=True,
        cookie_secret=options.cookie_secret
    )
    server = tornado.httpserver.HTTPServer(application) #TODO other options
    LOG.info('Starting HTTP/WS server...')
    bind(server, options.web_port, options.web_usocket)
コード例 #4
0
ファイル: __init__.py プロジェクト: thypon/bits-server
def start():
    """Connect and bind listeners. **MUST** be called at startup."""
    __inject_broadcast()

    fonera = RemoteListener()
    LOG.info('Starting remote control...')
    LOG.info('My IP address is {}, remote IP address is {}'.format(
        options.control_local_address, options.control_remote_address))
    bind(fonera,
         options.control_local_port,
         options.control_local_usocket,
         address=options.control_local_address)
コード例 #5
0
def start():
    """Connect and bind listeners. **MUST** be called at startup."""
    __inject_broadcast()

    fonera = RemoteListener()
    LOG.info('Starting remote control...')
    LOG.info(
        'My IP address is {}, remote IP address is {}'.format(
            options.control_local_address,
            options.control_remote_address
        )
    )
    bind(
        fonera,
        options.control_local_port,
        options.control_local_usocket,
        address=options.control_local_address
    )