uWebSockets-master

所属分类:Web服务器
开发工具:C/C++
文件大小:11311KB
下载次数:57
上传日期:2017-10-10 19:34:30
上 传 者5489323
说明:  由C++写的高性能websocket服务端,支持百万连接.
(High performance websocket server by C++ ,support 100K client.)

文件列表:
.travis.yml (132, 2017-04-07)
.vs (0, 2017-04-07)
.vs\VC++ (0, 2017-04-07)
.vs\VC++\v15 (0, 2017-04-07)
.vs\VC++\v15\.suo (3584, 2017-04-07)
.vs\VC++\v15\Browse.VC.db (30191616, 2017-04-07)
benchmarks (0, 2017-04-07)
benchmarks\beast.cpp (1237, 2017-04-07)
benchmarks\benchmark_results_scalability (3456, 2017-04-07)
benchmarks\crow.cpp (383, 2017-04-07)
benchmarks\gateway-config-minimal.xml (1622, 2017-04-07)
benchmarks\gorilla.go (977, 2017-04-07)
benchmarks\lws.cpp (3367, 2017-04-07)
benchmarks\Makefile (1901, 2017-04-07)
benchmarks\runGorilla.sh (97, 2017-04-07)
benchmarks\scalability.cpp (3666, 2017-04-07)
benchmarks\scalability_socketio.cpp (3594, 2017-04-07)
benchmarks\socketio.js (206, 2017-04-07)
benchmarks\throughput.cpp (5398, 2017-04-07)
benchmarks\throughput_socketio.cpp (6241, 2017-04-07)
benchmarks\uWS.cpp (246, 2017-04-07)
benchmarks\ws.js (270, 2017-04-07)
benchmarks\wsPP.cpp (1588, 2017-04-07)
Debug (0, 2017-04-07)
Debug\uWS.tlog (0, 2017-04-07)
examples (0, 2017-04-07)
examples\echo.cpp (243, 2017-04-07)
examples\multithreaded_echo.cpp (998, 2017-04-07)
ISSUE_TEMPLATE.md (1979, 2017-04-07)
LICENSE (869, 2017-04-07)
Makefile (1110, 2017-04-07)
misc (0, 2017-04-07)
misc\autobahn (0, 2017-04-07)
misc\Autobahn.json (548, 2017-04-07)
misc\autobahn\index.html (558439, 2017-04-07)
misc\images (0, 2017-04-07)
... ...

`μWS` is one of the most lightweight, efficient & scalable WebSocket & HTTP server implementations available. It features an easy-to-use, fully async object-oriented interface and scales to millions of connections using only a fraction of memory compared to the competition. While performance and scalability are two of our top priorities, we consider security, stability and standards compliance paramount. License is zlib/libpng (very permissive & suits commercial applications). * Autobahn tests [all pass](http://htmlpreview.github.io/?https://github.com/uWebSockets/uWebSockets/blob/master/misc/autobahn/index.html). * One million WebSockets require ~111mb of user space memory (104 bytes per WebSocket). * By far one of the fastest in both HTTP and WebSocket throughput (see table below). * Linux, OS X, Windows & [Node.js](http://github.com/uWebSockets/bindings) support. * Runs with raw epoll, libuv or ASIO (C++17-ready). * Valgrind & AddressSanitizer clean. * Permessage-deflate, SSL/TLS support & integrates with foreign HTTP(S) servers. * Multi-core friendly & optionally thread-safe via compiler flag UWS_THREADSAFE. [![](https://api.travis-ci.org/uWebSockets/uWebSockets.svg?branch=master)](https://travis-ci.org/uWebSockets/uWebSockets) [![](misc/images/patreon.png)](https://www.patreon.com/uWebSockets) ## Simple & modern The interface has been designed for simplicity and only requires you to write a few lines of code to get a working server: ```c++ #include int main() { uWS::Hub h; h.onMessage([](uWS::WebSocket *ws, char *message, size_t length, uWS::OpCode opCode) { ws->send(message, length, opCode); }); h.onHttpRequest([](uWS::HttpResponse *res, uWS::HttpRequest req, char *data, size_t length, size_t remainingBytes) { res->end(const char *, size_t); }); h.listen(3000); h.run(); } ``` Get the sources of the uws.chat server [here](https://github.com/uWebSockets/website/blob/master/main.cpp). Learn from the tests [here](tests/main.cpp). ## Widely adopted
## Not your average server μWS was designed to perform well across the board, not just in one specific dimension. With excellent memory usage paired with high throughput it outscales Socket.IO by 180x.
*Benchmarks are run with default settings in all libraries, except for `ws` which is run with the native performance addons. Read more about the benchmarks [here](benchmarks).* ## Getting started #### Dependencies First of all you need to install the required dependencies. This is very easily done with a good open source package manager like [Homebrew](http://brew.sh) for OS X, [vcpkg](https://github.com/Microsoft/vcpkg) for Windows or your native Linux package manager. * OpenSSL 1.x.x * zlib 1.x * libuv 1.3+ *or* Boost.Asio 1.x (both optional on Linux) If you wish to integrate with a specific event-loop you can define `USE_ASIO` or `USE_LIBUV` as a global compilation flag and then link to respective libraries. `USE_EPOLL` is default on Linux while other systems default to `USE_LIBUV`. * Fedora: `sudo dnf install openssl-devel zlib-devel` * Homebrew: `brew install openssl zlib libuv` * Vcpkg: `vcpkg install openssl zlib libuv` *and/or* `vcpkg install openssl:x***-windows zlib:x***-windows libuv:x***-windows` #### Compilation ###### OS X & Linux * `make` * `sudo make install` (or as you wish) ###### Windows * Compile `VC++.vcxproj` with Visual C++ Community Edition 2015 or later.

近期下载者

相关文件


收藏者