websockets apache 服务器兼容性 [英] websockets apache server compatibility

查看:37
本文介绍了websockets apache 服务器兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个应用程序,每当新数据通过 xml 到达文件夹时,它就会显示新数据.我想使用 html5 web sockets,但我对它应该如何完成感到困惑.我在我的机器上使用 xaamp 进行开发.我是否必须安装另一台服务器才能使用 websockets?apache 是否兼容,如果是,我如何与客户端建立连接.提前谢谢你..

I want to make an app that displays new data whenever they arrive inside a folder via xml. I want to use html5 web sockets but I am confused on how it should be done. I am using xaamp on my machine for development. Do I have to install another server to use websockets? Is apache as it is compatible and if yes how do I make the connection with the client. Thank you in advance..

推荐答案

您的选择是:

  1. 使用类似 mod_websocket 的东西,正如 Phillip Kovalev 所指出的那样.或者 pywebsocket.您也可以尝试 PHP WebSocket.
  2. 使用专用的自托管实时网络技术 用于服务器和客户端之间的实时通信.如果您这样做,您还需要定义一种应用程序进行实时 Web 服务器通信的方式 - 通常通过消息队列实现.
  3. 使用托管实时网络解决方案并卸载应用的实时推送方面.
  1. Use something like mod_websocket, as pointed out by Phillip Kovalev. Or pywebsocket. You could also try PHP WebSocket.
  2. Use a dedicated self-hosted realtime web technology for realtime communication between server and client. If you do this you'll also need to define a way of application to realtime web server communications - normally achieved through message queues.
  3. Use a hosted realtime web solution and offload the realtime push aspect of your application.

有人担心将 Apache 与这种类型的技术结合使用,因为这种技术在服务器和客户端之间保持长期运行的持久连接,而 Apache 并不知道在这方面做得很好.因此,最好的解决方案可能是:

There are concerns about using Apache with this type of technology since this technology maintains long-running persistent connections between the server and client and Apache isn't know to be too great at this. So, the best solution may be to:

  1. 使用第二个专用实时网络服务器,并使用 Apache 作为您的应用程序服务器
  2. 使用能够处理多个并发连接的自托管实时网络服务器
  3. 将托管服务与您的 Apache 应用服务器一起使用.

如果您不希望有很多并发连接,或者您只是在尝试这项技术,那么您可能只需要 Apache.

If you don't expect many concurrent connections or if you are just trying out the technology then it's possible that Apache alone will be all you need.

这篇关于websockets apache 服务器兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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