我需要服务器来使用HTML5的WebSockets吗? [英] Do I need a server to use HTML5's WebSockets?

查看:105
本文介绍了我需要服务器来使用HTML5的WebSockets吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用WebSockets时,是否需要编写服务器代码?换句话说,我的客户端应用程序中的JavaScript是否需要连接到专门的服务器,或者我现有的Apache服务器是否可以支持这个服务器?

解决方案 div>

服务器必须支持Web套接字。在HTTP中进行第一次握手后,服务器和客户端打开套接字连接。服务器必须能够理解并接受这个握手。



在我上一个项目中,我们使用最后一个Jetty版本运行了非常成功的web套接字连接。



27/02/2014:
现在我也在.net下实现了带有XSockets.net的websockets,并且像一个魅力一样工作,你甚至不需要web服务器(self主机)。 ASP.NET的WebSocket实现也很好。


When using WebSockets, will I need to write server code? In other words, will the JavaScript in my client application need to connect to a specialized server, or will my existing Apache server work to support this?

解决方案

The server has to support web sockets. After a first handshake in HTTP, the server and the client open a socket connection. The server must be able to understand and accept this handshake.

In my last project we run quite successfully web socket connections using the last Jetty version.

27/02/2014: Now I'm also implementing websockets under .net with XSockets.net and works like a charm, you don't even need a web server (self hosting). The WebSocket implementation of ASP.NET works also quite good.

这篇关于我需要服务器来使用HTML5的WebSockets吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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