将播放框架作为WebSocket客户端 [英] Play Framework as a WebSocket Client

查看:93
本文介绍了将播放框架作为WebSocket客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Play 2.3,正在查看有关将Akka用作WebSocket服务器的文档.但是,在文档中,它们没有指出Play是否可以连接到现有的WebSocket服务器.基本上,我对成为一个WebSocket客户端感兴趣,它将从WebSocket服务器接收消息.我的Play应用程序将与此WebSocket服务器进行双向请求/响应,然后最终我将发起终止.

I am using Play 2.3, was checking out the documentation for using Akka as a WebSocket Server. However in documentation they did not indicate if Play could connect to the existing WebSocket Servers. Basically I am interested in being a WebSocket Client who will receive messages from the WebSocket Server. My Play app will make bidirectional request/response with this WebSocket server then finally I will initiate the termination.

Play with Akka可以吗?

Is this possible with Play with Akka?

推荐答案

并非如此.目前,它仅充当服务器.

Not as it stands. Currently it only acts as a server.

您可以做的是使用 jetty这样的客户端Play本身的websocket ,然后根据需要处理数据.

What you could do is use a client like jetty websocket from Play itself, and then process the data as you see fit.

这篇关于将播放框架作为WebSocket客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆