首页 文章

如何手动测试lagom websocket API?

提问于
浏览
0

我下载了包含简单websocket endpoints 的Lagom示例项目 named("example-stream") .withCalls( namedCall("stream", stream) ).withAutoAcl(true) 当我启动应用程序并尝试打开websocket连接(ws:// localhost:9000 / stream)时,服务器日志打印:

[warn] akka.actor.ActorSystemImpl [sourceThread=application-akka.actor.default-dispatcher-53, akkaSource=akka.actor.ActorSystemImpl(application), sourceActorSystem=application, akkaTimestamp=18:02:21.293UTC] - HTTP header 'Sec-WebSocket-Extens ions: permessage-deflate' is not allowed in requests 20:02:21.301 [warn] runstats-stream [] - Could not negotiate a deserializer for type MessageProtocolImpl(Some(none/none),None,None), the default media type supported is MessageProtocolImpl(Some(text/plain),Some(utf-8),None)

为此,我使用名为Browser Websocket客户端的Firefox插件 . 据我所知,Websocket握手不需要或设置Content-Type,这显然是websocket endpoints 所期望的 .

我做错了什么或者生成的项目是否有效?

1 回答

  • 0

    你没有做错任何事 . Lagom 1.4.0提供了两种不同的服务器端websocket处理实现(netty vs AkkaHTTP) . Lagom中的默认实现是基于AkkaHTTP的,我们最近发现了issue . 该解决方案已经解决,但在我们发布Lagom 1.4.1之前无法使用 .

    与此同时,您可以在migration guide details on how to select a different server engine之后选择加入基于netty的实现(以前是默认设置) .

相关问题