摘要
Web Socket规范是作为HTML5的一部分提出的,其目标是在客户端浏览器和Web服务器之间实现全双工通信。目前主流浏览器已经提供了Web Socket客户端API,但是服务器端并没有标准的API。对Web Socket应用背景进行分析,重点描述WebSocket握手协议机制并在Linux平台环境下使用Ruby编程语言实现一个简单的Web Socket服务器。实验证明所描述的研究能够在服务器端成功完成Web Socket的握手过程并建立通信连接。
WebSocket specification is proposed as a part of the HTMLS, its aim is to realise a full-duplex communication between client browser and Web server. Nowadays, most popular browsers have already provided WebSocket API at client side, but there is no standard API on server site. In this paper we analyse the background of Web applications, elaborately describe the WebSocket handshake protocol mechanism, and implement a simple WebSocket server by using Ruby programming language under Linux platform environment. Experiment proves that the study described in this paper can successfully complete a WebSocket handshake process and establish communication connection on server site.
出处
《计算机应用与软件》
CSCD
2015年第1期128-131,178,共5页
Computer Applications and Software