高速公路网

2024-10-01 07:28:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用autobahn websocket评估并构建一个简单的websocket服务器

是否有人使用过子类WrappingWebSocketServerProtocol,是否有使用此实现的示例?与WebSocketServerProtocol相比有什么好处?要重写/实现哪些子方法

谢谢你


Tags: 方法服务器示例子类websocketautobahnwebsocketserverprotocolwrappingwebsocketserverprotocol
2条回答

如果有人感兴趣,可以在下面的示例列表中找到一些答案:

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/wrapping

AutobahnPython允许您在基于流的传输协议(如Telnet、IMAP、VNC等)上运行任何构建在WebSocket上的应用程序协议。对于这种包装,您将使用WrappingWebSocketServerProtocol和相关类。在

AutobahnPython还允许在任何基于流的传输协议/设施(如Unix域套接字、管道、串行等)上运行WebSocket。为此,您将使用端点https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo_endpoints

现在,上面两个都涵盖了特殊的用例,如果你想做一个“普通”的WebSocket应用,你只需要使用WebSocketServerProtocol和相关的类。在

相关问题 更多 >