[This article is original, if reproduced, please indicate the source http://blog.csdn.net/yl02520/article/]
If we want to build a Web server, we will have a lot of options, the market also has a lot of mature products for us to apply, such as open source Apache, after installation only simple configuration (or the default configuration) can work. But if you want to build a websocket server is not so easy, because WebSocket is a new communication protocol, is currently a draft, not a standard, the market is not mature WebSocket server or library to achieve WebSocket protocol, We have to write our own code to parse and assemble the websocket packets. In order to complete a WebSocket server, it is estimated that all people want to give up, fortunately, there are several relatively good open source library in the market for us to use, such as Pywebsocket,websocket-node, libwebsockets, etc. These library files have implemented the encapsulation and parsing of websocket packets, and we can call these interfaces, which in large part reduces our workload.
The following is a brief introduction to these open Source library files.
1. Pywebsocket
Pywebsocket is written in Python language, it can be a good cross-platform, the expansion is relatively simple, currently webkit use it to build WebSocket server to do layouttest.
We can get the source code through the following command
SVN checkouthttp://pywebsocket.googlecode.com/svn/trunk/pywebsocket-read-only
More detailed information can be obtained from the http://code.google.com/p/pywebsocket/.
2. Websocket-node
Websocket-node is written in JavaScript, the library is built on Nodejs, for friends who are familiar with JavaScript, and HTML5 and Web apps are becoming more popular, Nodejs is also getting a wide range of attention.
We can get the source code from the connection below
Https://github.com/Worlize/Websocket-Node
3. Libwebsockets
Libwebsockets is written in C + + language, can be customized more strongly, from the beginning of TCP listening to the completion of the package we can participate in programming.
We can get the source code from the following command
git clone git://git.warmcat.com/libwebsockets