WebSocket (5)--WebSocket Server

Source: Internet
Author: User
Tags svn git clone in python

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.