简体   繁体   English

基于Apache服务的websocket功能

[英]websocket feature over apache based service

I have web application settled on Apache server, and using php. 我已经将Web应用程序安置在Apache服务器上,并使用php。 I wish to put inside some kind of widget like "real time, multi-user application". 我希望放入某种小部件,例如“实时,多用户应用程序”。 I was looking around how to solve it and decided to use html5 (canvas). 我一直在寻找解决方法,并决定使用html5(画布)。 To make it multi-user and real time I was thinking about Websockets. 为了使它成为多用户实时应用,我正在考虑Websockets。 I am not familiar with it at all, but I have read that generally it is possible to use Websockets over Apache but have no idea how to run it. 我一点都不熟悉,但是我已经读过,通常可以在Apache上使用Websockets,但不知道如何运行它。

1)Can anyone help me to start with it? 1)有人可以帮我开始吗? How to settle Websocket server(?) over Apache (I guess what I have written is a silly thing, but I hope I have explained what I mean) 如何通过Apache解决Websocket服务器(?)(我想我写的东西很傻,但是我希望我已经解释了我的意思)

2)Maybe there is another solution for my needs? 2)也许我还有其他解决方案? Some different way (I hope simpler, not necessarily better) which will make my app real time and multi-user, than Websockets. 与Websockets相比,某些不同的方式(我希望更简单,但不一定更好)将使我的应用实时和多用户。

Thanks in advance for help. 在此先感谢您的帮助。

AFAIK Apache httpd doesn't support Websocket off the box so you would have to install additional third party module most likely. AFAIK Apache httpd不支持Websocket,因此您很可能必须安装其他第三方模块。 Here is one I found. 这是我找到的一个。 I haven't tried it myself. 我自己还没有尝试过。 Once it's done client side (JavaScript) should be identical across all implementations so you could follow any tutorial available on the net. 一旦完成,客户端(JavaScript)在所有实现中都应该相同,因此您可以按照网络上的任何可用教程进行学习。

Websocket is cool thing, very fast, I'm using it on number of projects but from Java/Jetty. Websocket是一件很酷的事情,非常快,我在Java / Jetty上的许多项目中使用它。 Keep in mind that not all browsers support Websocket yet by default and also Websocket traffic won't traverse all proxies so make sure you tested all that. 请记住,并不是所有浏览器默认都支持Websocket,并且Websocket流量也不会遍历所有代理,因此请确保已对所有这些进行了测试。

1)Can anyone help me to start with it? 1)有人可以帮我开始吗? How to settle Websocket server(?) over Apache (I guess what I have written is a silly thing, but I hope I have explained what I mean) 如何通过Apache解决Websocket服务器(?)(我想我写的东西很傻,但是我希望我已经解释了我的意思)

Have a look at: 看一下:

2)Maybe there is another solution for my needs? 2)也许我还有其他解决方案? Some different way (I hope simpler, not necessarily better) which will make my app real time and multi-user, than Websockets. 与Websockets相比,某些不同的方式(我希望更简单,但不一定更好)将使我的应用实时和多用户。

In my opinion the easiest way to add realtime functionality to a web app, and in particular a PHP application, where managing concurrent connections is a problem, is to use a realtime hosted service (such as Pusher who I work for). 在我看来,将实时功能添加到Web应用程序(尤其是PHP应用程序)时,最简单的方法是使用实时托管服务 (例如,我为之工作的Pusher ),在该应用程序中,管理并发连接是一个问题。

  • No install 没有安装
  • No maintanence 没有维护
  • JavaScript client and PHP server library available and easily used JavaScript客户端和PHP服务器库可用且易于使用
  • Scaling handled for you 为您处理缩放
  • Feature rich 功能丰富

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM