Font Size: a A A

Research And Implementation Of Server Push Technology Based On WebSocket

Posted on:2019-01-05Degree:MasterType:Thesis
Country:ChinaCandidate:Y Y HuFull Text:PDF
GTID:2428330566999357Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the rapid progress of the Internet,Internet applications tend to diversify.Real-time communication is one of the hot spots in the current technical field.The traditional Web application adopts the HTTP protocol,in which the client initiates the request and the server responds passively.If we want to create two-way real-time communication Web applications between client and server,we usually use the HTTP polling mechanism which wastes network bandwidth and server resources to get the latest data of the server in real time.WebSocket is a computer communication protocol proposed by W3 C that provides full-duplex communication channels over a single TCP connection with bi-directional communication,low overhead,and extensible features.The communication scheme based on WebSocket protocol can improve the pushing ability of the server,realize real-time data communication,and effectively avoid the waste of resources in traditional real-time communication schemes.In order to pursue more convenient and efficient real-time Web application implementation,based on in-depth research of WebSocket,this paper designs and implements a real-time campus information push system based on WebSocket.The main tasks include:(1)System architecture design and technical selection.Combined with the functional requirements analysis of real-time campus information push and the study and research of more than ten kinds of Web application development frameworks and languages,the system finally adopts the three-tier architecture of client,Web server and data layer.The server is based on Node.js,which uses event-driven,non-blocking model,and uses Express for web application development which is the standard server framework of Node.js;The front-end development uses the framework of Bootstrap,the template engine of Pug,and the library of jQuery;The data layer uses the MySQL database.In addition,in order to improve the development efficiency,the most advanced distributed version control system of Git is introduced to solve the problem of version rollback and branch management in the process of system development.(2)Web server development that supports WebSocket.A Web server that supports both HTTP and WebSocket is developed,which uses the framework of Express and the module of WS that provides the WebSocket API.(3)The function realization and test of the system.The real-time campus information push system designed and implemented in this paper includes five major functional modules: WebSocket communication module,message push module,message display module,file module,and intelligent search module.In addition to normal communication,WebSocket communication module has the function of heartbeat reconnection and anti cross-site hijacking attack;The intelligent search module allows the search for any phrase and displays recommendations according to the input,like the Baidu and Google's advanced search box.In this paper,a complete functional test is carried out,and results show the WebSocket solution is feasible.
Keywords/Search Tags:WebSocket, real-time push solution of campus information, Node.js, Git
PDF Full Text Request
Related items