本文整理汇总了Python中autobahn.twisted.websocket.WampWebSocketServerFactory._cookies方法的典型用法代码示例。如果您正苦于以下问题:Python WampWebSocketServerFactory._cookies方法的具体用法?Python WampWebSocketServerFactory._cookies怎么用?Python WampWebSocketServerFactory._cookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.twisted.websocket.WampWebSocketServerFactory
的用法示例。
在下文中一共展示了WampWebSocketServerFactory._cookies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RouterSessionFactory
# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerFactory import _cookies [as 别名]
from autobahn.twisted.wamp import RouterSessionFactory
session_factory = RouterSessionFactory(router_factory)
session_factory.session = MyRouterSession
# start an embedded application component ..
##
component_config = types.ComponentConfig(realm="realm1")
component_session = TimeService(component_config)
session_factory.add(component_session)
# create a WAMP-over-WebSocket transport server factory
##
from autobahn.twisted.websocket import WampWebSocketServerFactory
transport_factory = WampWebSocketServerFactory(session_factory, args.wsurl, debug=False, debug_wamp=args.debug)
transport_factory.protocol = ServerProtocol
transport_factory._cookies = {}
transport_factory.setProtocolOptions(failByDrop=False)
from twisted.web.server import Site
from twisted.web.static import File
from autobahn.twisted.resource import WebSocketResource
# we serve static files under "/" ..
root = File(".")
# .. and our WebSocket server under "/ws"
resource = WebSocketResource(transport_factory)
root.putChild("ws", resource)
# run both under one Twisted Web Site