A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.

Overview

This project has moved to https://gitlab.com/eidheim/Simple-WebSocket-Server.

Simple-WebSocket-Server

A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Asio (both Boost.Asio and standalone Asio can be used) and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.

See https://gitlab.com/eidheim/Simple-Web-Server for an easy way to make REST resources available from C++ applications. Also, feel free to check out the new C++ IDE supporting C++11/14/17: https://gitlab.com/cppit/jucipp.

Features

  • RFC 6455 mostly supported: text/binary frames, fragmented messages, ping-pong, connection close with status and reason.
  • Asynchronous message handling
  • Thread pool if needed
  • Platform independent
  • WebSocket Secure support
  • Timeouts, if any of SocketServer::timeout_request and SocketServer::timeout_idle are >0 (default: SocketServer::timeout_request=5 seconds, and SocketServer::timeout_idle=0 seconds; no timeout on idle connections)
  • Simple way to add WebSocket endpoints using regex for path, and anonymous functions
  • An easy to use WebSocket and WebSocket Secure client library
  • C++ bindings to the following OpenSSL methods: Base64, MD5, SHA1, SHA256 and SHA512 (found in crypto.hpp)

Usage

See ws_examples.cpp or wss_examples.cpp for example usage.

Dependencies

  • Boost.Asio or standalone Asio
  • OpenSSL libraries

Compile

Compile with a C++11 supported compiler:

mkdir build
cd build
cmake ..
make
cd ..

Run server and client examples

WS

./build/ws_examples

WSS

Before running the WSS-examples, an RSA private key (server.key) and an SSL certificate (server.crt) must be created. Follow, for instance, the instructions given here (for a self-signed certificate): http://www.akadia.com/services/ssh_test_certificate.html

Then:

./build/wss_examples
Issues
  • Messages split among frames aren't reasembled

    Messages split among frames aren't reasembled

    While receiving message that is split among multiple frames, websocket client threats them as individual messages. Other websocket libraries reasamble the messages correctly so i know it isn't something wrong with the server binary i'm connecting to. Possible relavant place in code: https://github.com/eidheim/Simple-WebSocket-Server/blob/master/client_ws.hpp#L565 It doesn't check either if FIN bit or 0x00 opcode(continue message?) It would be nice if the library reassembled messages or at least provided us a feedback that it isn't a complete message at least, since AFAIK there can't be other messages incoming until the first one arrives.

    Example sent from server:

    {
      "Key": "data"
    }
    

    Example received in Simple-Websocket-Client: message 1:

    {
      "K
    

    message 2:

    ey":"data"
    

    message 3:

    }
    

    EDIT: This has no relation with message size, the server binary that runs websocket server just likes fragmented messages...

    opened by moonshadow565 25
  • Why message's data is a stream?

    Why message's data is a stream?

    From my understanding of your code, each time a message is received, the data is copied to a fresh message object. So the data stored in the message won't change or increase: it could be a simple string instead of an istream. Then, the length field would be superfluous. In fact, the Message class could even inherit from std::string.

    The benefits would be a much easier manipulation of the message and most of the time at least one less copy of it.

    I could propose a patch if this make sense to you.

    opened by lgerardSRI 20
  • Multiple connections

    Multiple connections

    I'm not sure why I would be getting this issue, but if I have multiple simultaneous connections, onmessage seems to all be directed on to the last connection, and not the connection it originated from.

    Is there something wrong with my code?

    opened by Victordmdb 18
  • Problem With Sending Multiple Messages to Client

    Problem With Sending Multiple Messages to Client

    Related to #11.

    Following the ws_example.cpp the code below shows that sending multiple responses to a client is not handled properly. I want to be able to send multiple responses to the client so it can process them separately. Am I using the library incorrectly or is this a concurrency issue? The example seems to be independent of the variable NUM_THREADS, I think the problem is how the send function on the server handles the streams.

    #include "server_ws.hpp"
    #include "client_ws.hpp"
    
    #define NUM_THREADS 4
    
    using namespace std;
    
    typedef SimpleWeb::SocketServer<SimpleWeb::WS> WsServer;
    typedef SimpleWeb::SocketClient<SimpleWeb::WS> WsClient;
    
    void send_message(WsServer* server, shared_ptr<WsServer::Connection> connection, std::string msg)
    {
      cout << "Server: Sending Message: "  << msg << endl;
      auto send_stream=make_shared<WsServer::SendStream>();
      *send_stream << msg;
      //server.send is an asynchronous function
      server->send(connection, send_stream, [server, connection](const boost::system::error_code& ec){
          if(ec) {
          cout << "Server: Error sending message. " <<
          //See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings
          "Error: " << ec << ", error message: " << ec.message() << endl;
          }
          });
    }
    
    int main() {
      //WebSocket (WS)-server at port 8080 using 4 threads
      WsServer server(8080, NUM_THREADS);
    
      auto& test=server.endpoint["^/test/?$"];
    
      test.onmessage=[&server](shared_ptr<WsServer::Connection> connection, shared_ptr<WsServer::Message> message) {
        auto message_str=message->string();
        cout << "Server: Message received: \"" << message_str << "\" from " << (size_t)connection.get() << endl;
        send_message(&server, connection, "test1");
        send_message(&server, connection, "test2");
      };
    
      test.onopen=[](shared_ptr<WsServer::Connection> connection) {
        cout << "Server: Opened connection " << (size_t)connection.get() << endl;
      };
    
      //See RFC 6455 7.4.1. for status codes
      test.onclose=[](shared_ptr<WsServer::Connection> connection, int status, const string& reason) {
        cout << "Server: Closed connection " << (size_t)connection.get() << " with status code " << status << endl;
      };
    
      //See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings
      test.onerror=[](shared_ptr<WsServer::Connection> connection, const boost::system::error_code& ec) {
        cout << "Server: Error in connection " << (size_t)connection.get() << ". " << 
          "Error: " << ec << ", error message: " << ec.message() << endl;
      };
    
    
    
      thread server_thread([&server](){
          //Start WS-server
          server.start();
          });
    
      //Wait for server to start so that the client can connect
      this_thread::sleep_for(chrono::seconds(1));
    
      WsClient client("localhost:8080/test");
      client.onmessage=[&client](shared_ptr<WsClient::Message> message) {
        auto message_str=message->string();
    
        cout << "Client: Message received:" << message_str << endl;
      };
    
      client.onopen=[&client]() {
        cout << "Client: Opened connection" << endl;
    
        string message="Hello";
        cout << "Client: Sending message: \"" << message << "\"" << endl;
    
        auto send_stream=make_shared<WsClient::SendStream>();
        *send_stream << message;
        client.send(send_stream);
      };
    
      client.onclose=[](int status, const string& reason) {
        cout << "Client: Closed connection with status code " << status << endl;
      };
    
      //See http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference.html, Error Codes for error code meanings
      client.onerror=[](const boost::system::error_code& ec) {
        cout << "Client: Error: " << ec << ", error message: " << ec.message() << endl;
      };
    
      client.start();
    
      server_thread.join();
    
      return 0;
    }
    
    opened by joshblum 14
  • Connection closed before receiving a handshake response

    Connection closed before receiving a handshake response

    I simply did

    git clone https://github.com/eidheim/Simple-WebSocket-Server.git

    Then compiled in linux

    g++ -O3 -std=c++1y ws_examples.cpp -lboost_system -lcrypto -lpthread -o ws_examples

    Wrote a sample JS client as specified in documentation

    <!Doctype html>
    <html>
        <head>
            <title>
                Web Socket 
            </title>
       </head>
    <body>
        <script>
    
    var ws=new WebSocket("ws://localhost:8080/echo");
    ws.onmessage=function(evt){console.log(evt.data);};
    ws.send("test");
    
    
        </script>
    </body>
    </html>
    

    But when I run client and server, It gives error

    Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state. WebSocket connection to 'ws://localhost:8080/echo' failed: Connection closed before receiving a handshake response

    Can you please direct where is things going wrong ?

    Ubuntu 14 Boost 0.9.8 No trace was received on server side

    opened by mkkhedawat 14
  • asynchronous onmessage ?

    asynchronous onmessage ?

    Hi there,

    looking at client_ws.hpp, it is not clear to me whether the "ping" between client and server will go on in the background, while onmessage() does its work (see "read_message_content" -- it appears as if either the ping or the onmessage function run, but not both).

    My use-case may involve quite long times without any user-defined interaction between client and server (from minutes to days), while the data obtained from the server is processed within the onmessage function. This is for an application involving distributed parametric optimisation, so data transfers are generally small -- a few kilobytes -- but evaluation times may be quite long.

    So, do I need to send my calculation into the background in its own thread and if so, do I need to take care of the synchronization of the final client.send() command issued by this thread ? After all the ping will continue in any case, if I do "expensive" calculations in a thread.

    I would also like to understand what action is taken by client and server if the ping does not get an answer for a predefined number of submissions or time. Will this result in an onerror() call?

    In any case, thanks for a great library!

    Kind Regards, Beet

    opened by rberlich 13
  • possible race condition on message send

    possible race condition on message send

    When sending multiple (large) messages, oftentimes the send fails with odd messages about protocol corruption.

    Haven't dug into the code too deeply, but it seems this can be a possible issue. Any thoughts for workarounds?

    opened by joshblum 12
  • Message size limit (somewhere between 60kB and 70kB)

    Message size limit (somewhere between 60kB and 70kB)

    In order to rule out the possibility that this issue had anything to do with message content, I generated a file that was 75k of the letter h. I then sent a message containing that payload from the server to the client.

    The server acted as if nothing was wrong, but nothing happened at the client, so I sent it again.

    This time, the client received the message. Then I sent it again.

    This time, the client closed the connection:

    Closed Connection with code: 26728 Reason: hhhhhhü⌂ ☺%╘ ☺%╘hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
    

    I find that I get this behavior with 70000 h's, but 60000 h's works just fine.

    I'm building a cross-platform app and I noticed this behavior while using Visual Studio 2015 on Windows Server 2012. I haven't tested it out on gcc yet, but I will do so next time I'm in Linux mode.

    Here's a gist containing the code I'm using.

    opened by MatrixManAtYrService 11
  • re again WssClient::start causes on_error

    re again WssClient::start causes on_error

    WssClient::start and later network error, on_error enters and WssClient::start executes again, on_open comes in. When you send a message, on_error occurs, and again when WssClient::start, it goes on_open. When you send a message, on_error occurs again.

    opened by brant-m 10
  • Fixes some compiler errors in MSVS 2012 and a crash if server gets deleted directly after calling io_service->stop()

    Fixes some compiler errors in MSVS 2012 and a crash if server gets deleted directly after calling io_service->stop()

    I know, you are not so much into supporting non C++11-standard compilers, so I can understand if you don't want to pull in the first commit 560cb90 (which looks a bit ugly).

    The commit 6f6c1c9 should be important on any compiler (I am wondering, why this is compiling with other versions as std::mutex isn't copy- or movable and therefore Endpoint can't be used in an std::map<> like this).

    cfa4f1f is a minor fix, for a problem, which is caused, by using a global io_service, which lives longer than the WebsocketServer instance. After calling io_service::stop() the acceptor gets notified of the stop, which ends in an access violation because he tries to call accept() on a deleted object.

    opened by classix-do 10
  • Fix ws_examples compilation on osx. wss_examples is broken

    Fix ws_examples compilation on osx. wss_examples is broken

    For the wss_examples I get the following error:

    Undefined symbols for architecture x86_64:
      "_ERR_remove_thread_state", referenced from:
          boost::asio::ssl::detail::openssl_init_base::do_init::~do_init() in wss_examples.cpp.o
      "_TLSv1_1_client_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
      "_TLSv1_1_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
      "_TLSv1_1_server_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
      "_TLSv1_2_client_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
      "_TLSv1_2_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
      "_TLSv1_2_server_method", referenced from:
          boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in wss_examples.cpp.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [wss_examples] Error 1
    make[1]: *** [CMakeFiles/wss_examples.dir/all] Error 2
    make: *** [all] Error 2
    

    Any ideas for a fix? Trying to address #18

    opened by joshblum 10
  • Fix Pong payload

    Fix Pong payload

    According to the Websocket RFC, a Pong frame sent in response to a Ping frame must have identical "Application data" as found in the message body of the Ping frame being replied to.

    The current implementation always sends an empty Pong message. Problems arise when communicating with other implementations conforming to the RFC, which would discard an empty Pong message, in case the original Ping message wasn't empty.

    This pull request contains a fix to this issue.

    opened by lorenzodonini 0
  • Standalone Asio not found - but asio.hpp is present

    Standalone Asio not found - but asio.hpp is present

    Hi, thank you for this library!

    I'm trying to use the library with ASIO but, although it's installed in my system, cmake fails.

    My environment: OS: Archlinux compiler: clang cmake version: 3.10.3

    Steps to reproduce:

    git clone https://github.com/eidheim/Simple-WebSocket-Server/
    cd Simple-WebSocket-Server
    mkdir build
    cd build
    cmake -DUSE_STANDALONE_ASIO=ON ..
    

    Error: Standalone Asio not found

    But ls /usr/include/asio* returns:

    /usr/include/asio.hpp
    
    /usr/include/asio:
    associated_allocator.hpp     basic_socket.hpp              buffered_stream.hpp            defer.hpp                      handler_invoke_hook.hpp    is_write_buffered.hpp          serial_port_base.hpp         strand.hpp                 unyield.hpp
    associated_executor.hpp      basic_socket_iostream.hpp     buffered_write_stream_fwd.hpp  detail                         handler_type.hpp           local                          serial_port.hpp              streambuf.hpp              use_future.hpp
    async_result.hpp             basic_socket_streambuf.hpp    buffered_write_stream.hpp      dispatch.hpp                   high_resolution_timer.hpp  packaged_task.hpp              serial_port_service.hpp      stream_socket_service.hpp  uses_executor.hpp
    basic_datagram_socket.hpp    basic_streambuf_fwd.hpp       buffer.hpp                     error_code.hpp                 impl                       placeholders.hpp               signal_set.hpp               system_context.hpp         version.hpp
    basic_deadline_timer.hpp     basic_streambuf.hpp           buffers_iterator.hpp           error.hpp                      io_context.hpp             posix                          signal_set_service.hpp       system_error.hpp           waitable_timer_service.hpp
    basic_io_object.hpp          basic_stream_socket.hpp       completion_condition.hpp       execution_context.hpp          io_context_strand.hpp      post.hpp                       socket_acceptor_service.hpp  system_executor.hpp        wait_traits.hpp
    basic_raw_socket.hpp         basic_waitable_timer.hpp      connect.hpp                    executor.hpp                   io_service.hpp             raw_socket_service.hpp         socket_base.hpp              system_timer.hpp           windows
    basic_seq_packet_socket.hpp  bind_executor.hpp             coroutine.hpp                  executor_work_guard.hpp        io_service_strand.hpp      read_at.hpp                    spawn.hpp                    thread.hpp                 write_at.hpp
    basic_serial_port.hpp        buffered_read_stream_fwd.hpp  datagram_socket_service.hpp    generic                        ip                         read.hpp                       ssl                          thread_pool.hpp            write.hpp
    basic_signal_set.hpp         buffered_read_stream.hpp      deadline_timer.hpp             handler_alloc_hook.hpp         is_executor.hpp            read_until.hpp                 ssl.hpp                      time_traits.hpp            yield.hpp
    basic_socket_acceptor.hpp    buffered_stream_fwd.hpp       deadline_timer_service.hpp     handler_continuation_hook.hpp  is_read_buffered.hpp       seq_packet_socket_service.hpp  steady_timer.hpp             ts
    

    Hence asio.hpp is present and the whole asio library too.

    How can I fix this? (My guess is that the problem is related to cmake somehow)

    Thank you

    opened by galeone 4
  • [suggest] Send/Broadcast and Text/BinaryMode

    [suggest] Send/Broadcast and Text/BinaryMode

    Hello, @eidheim

    First, thanks to make this Simple WebSocket.

    I needed to send binary mode. I found the article, https://github.com/eidheim/Simple-WebSocket-Server/issues/30, about this, and applied to my project.

    FYI, here is my wrappers. Furthermore, I wish to consider these warpping functions, and merged into SimpleWeb::SocketServer.

    Sincerely, YeonHo Park from South Korea. Thanks.

    using WsServer = SimpleWeb::SocketServer<SimpleWeb::WS>;
    WsServer m_ws_server;
       void SendText( shared_ptr<WsServer::Connection> connection,
                      const std::string& message,
                      const std::function<void( const error_code& )>& callback = nullptr );
       void SendBinary( shared_ptr<WsServer::Connection> connection,
                        const std::shared_ptr<WsServer::SendStream>& send_stream,
                        const std::function<void( const error_code& )>& callback = nullptr );
       void BroadcastBinary( const std::shared_ptr<WsServer::SendStream>& send_stream,
                             const std::function<void( const error_code& )>& callback = nullptr );
       void BroadcastText( const std::string& message_to_send,
                           const std::function<void( const error_code& )>& callback = nullptr );
    
    void Websocket::SendText( shared_ptr<WsServer::Connection> connection,
                              const std::string& message,
                              const std::function<void( const error_code& )>& callback )
    {
       auto send_stream = make_shared<WsServer::SendStream>();
       *send_stream << message;
       connection->send( send_stream, callback, 129 ); // fin_rsv_opcode: 129 = one fragment & text.
    }
    
    void Websocket::SendBinary( shared_ptr<WsServer::Connection> connection,
                                const std::shared_ptr<WsServer::SendStream>& send_stream,
                                const std::function<void( const error_code& )>& callback )
    {
       connection->send( send_stream, callback, 130 ); // fin_rsv_opcode: 130 = one fragment & binary.
    }
    
    void Websocket::BroadcastBinary( const std::shared_ptr<WsServer::SendStream>& send_stream,
                                     const std::function<void( const error_code& )>& callback )
    {
       for( auto& a_connection : m_ws_server.get_connections() )
          SendBinary( a_connection, send_stream, callback );
    }
    
    void Websocket::BroadcastText( const string& message_to_send, 
                                   const std::function<void( const error_code& )>& callback )
    {
       for( auto& a_connection : m_ws_server.get_connections() )
          SendText( a_connection, message_to_send, callback );
    }
    
    // example.
    auto send_stream = make_shared<WsServer::SendStream>();
    *send_stream << YOUR_BINARY_DATA;
    Websocket::getInstance()->BroadcastBinary( send_stream );
    
    opened by nicezic 1
  • Can't use wss client

    Can't use wss client

    Got this error testing wss client

    terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
      what():  context: asio.ssl error
    Aborted
    

    $ ssh -V OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016

    $ dpkg -s libboost-dev | grep 'Version' Version: 1.58.0.1ubuntu1

    opened by CrackerHax 5
  • Access violation exeption

    Access violation exeption

    When client disconnect the send function throws an exception in 'cancel_timeout()' - 'std::unique_lockstd::mutex lock(timer_mutex);' row. The exception is: "Exception thrown at 0x09643473 (msvcp140d.dll) in mtsrv.dev.exe: 0xC0000005: Access violation reading location 0xDDDDDDDD."

    This happens when client disconnected at the same time when server is sending data.

    opened by danielzhelyazkov 3
Releases(v2.0.0-rc3)
  • v2.0.0-rc3(Nov 25, 2017)

    Breaking changes:

    • Removed ::SendStream::consume since users should create a new SendStream instead of using this function
    • Removed ::Connection::send(const std::string&,) convenience function in preparation for a better solution
    • Server::Request::remote_endpoint_address and Server::Request::remote_endpoint_port are now functions to reduce unnecessary instructions. Also fixed issue with the previous variables that were not correctly set.

    Notable changes:

    • Added and resolved gcc and clang -Wsign-conversion warnings
    • Added client support for Server Name Indication
    • Implemented timeouts for SocketClient
    • All boost dependencies should now be removed when using standalone asio
    • Added Client::Config::header for cases where additional header fields are needed for the handshake
    • Clients now accepts 101 status codes in the handshake response without checking the status code text. This resolves the issue of different servers responding with different status code texts.
    • Modernized all CMakeLists.txt files, and made it easier to use Simple-WebSocket-Server as a sub-project
    • Added MSVC support to cmake files (not tested). Some tests are disabled due to lacking MSVC options.
    • Can now set maximum message size in WsServer:: and WsClient::config
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-rc2(Jul 31, 2017)

    Breaking change:

    • To reduce memory consumption and copying when sending the same message to several connections, SocketServer::Connection::send no longer consumes the buffer. The examples have been simplified according to this change.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-rc1(Jul 30, 2017)

    Breaking changes:

    • SocketServer::Connection::path is now split into path and query_string. This means that for instance auto server.endpoint["^/echo$"] will match both GET /echo HTTP/1.1 and GET /echo?a=b HTTP/1.1 requests.
    • SocketServer::send has been moved to SocketServer::Connection::send
    • Deprecated functions has been removed
    • Added SocketClient::Connection parameter to SocketClient's on_* functions

    Notable changes:

    • Standalone Asio is now supported
    • Handlers are now safely canceled on Client and Server destruction. This is especially useful when using an external io_service
    • Added convenience SocketServer::Connection::Send(const std::string &, ...) function
    • Reformatting of the source code
    • Added utility.hpp
    • Added function for query string parsing
    • SocketClient::stop and SocketServer::stop now closes current connections
    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Jun 10, 2017)

    Various cleanups and improvements, most notably:

    • Added client verification when a verify file is passed to SocketServer
    • Added session_id_context for session reuse
    • Cleanup and additions to Crypto
    • Cleanup of server-constructors. Previous constructors have been marked as deprecated
    • Renamed onopen to on_open, onmessage to on_message, onclose to on_close, and onerror to on_error. Old variables are marked as deprecated
    • Header fields is now stored in unordered_multimap
    • Made header parameters case insensitive
    • Added possibility to upgrade a request from an external service to a websocket connection
    Source code(tar.gz)
    Source code(zip)
  • v1.3(Dec 14, 2016)

    Important: Security fix for Client: added host verification

    Other improvements:

    • Added tcp no_delay socket option
    • Added io_test and CI
    • Changed class visibility from private to protected
    • Force tlsv12 in SocketClient
    • Fixed a bug on 32-bit system when processing larger messages
    • get_connections now returns an unordered_set instead of set
    • Fewer copies of shared_ptr objects
    • Can now replace or set boost::asio::io_service
    • Using std::regex if possible
    • Now passing client errors to onerror
    • Fixed Crypto::Base64::encode for newer OpenSSL versions
    • Various minor bug fixes
    Source code(tar.gz)
    Source code(zip)
  • v1.2.4(Jan 8, 2016)

  • v1.2.3(Dec 20, 2015)

    • Fixes crash when sending multiple messages and client disconnects before all messages are received (the connection objects are kept alive till send_from_queue is finished)
    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Dec 9, 2015)

  • v1.2.1(Nov 2, 2015)

    Major bugfix: no more interleaving messages when sending multiple messages to the same server or client. This previously could lead to corrupted messages.

    Source code(tar.gz)
    Source code(zip)
Owner
Ole Christian Eidheim
Moved to GitLab: https://gitlab.com/eidheim
Ole Christian Eidheim
Minimalistic socket library inspired by Asio/Boost Asio, implemented in 1 single header file

cz-spas czspas (Small Portable Asynchronous Sockets) is minimalistic socket library inspired by Asio/Boost Asio, implemented in 1 single header file.

Rui Figueira 25 Jun 12, 2022
HTTP and WebSocket built on Boost.Asio in C++11

HTTP and WebSocket built on Boost.Asio in C++11 Branch Linux/OSX Windows Coverage Documentation Matrix master develop Contents Introduction Appearance

Boost.org 3.5k Aug 10, 2022
Boost::ASIO low-level redis client (connector)

bredis Boost::ASIO low-level redis client (connector), github gitee Features header only zero-copy (currently only for received replies from Redis) lo

Ivan Baidakou 142 Jul 21, 2022
cuehttp is a modern c++ middleware framework for http(http/https)/websocket(ws/wss).

cuehttp 简介 cuehttp是一个使用Modern C++(C++17)编写的跨平台、高性能、易用的HTTP/WebSocket框架。基于中间件模式可以方便、高效、优雅的增加功能。cuehttp基于boost.asio开发,使用picohttpparser进行HTTP协议解析。内部依赖了nl

xcyl 26 Jul 21, 2022
Packio - An asynchronous msgpack-RPC and JSON-RPC library built on top of Boost.Asio.

Header-only | JSON-RPC | msgpack-RPC | asio | coroutines This library requires C++17 and is designed as an extension to boost.asio. It will let you bu

Quentin Chateau 49 Aug 8, 2022
Asynchronous gRPC with Boost.Asio executors

asio-grpc This library provides an implementation of boost::asio::execution_context that dispatches work to a grpc::CompletionQueue. Making it possibl

Dennis 138 Aug 8, 2022
Multithreaded client socket server

-------------------------------------------------------------------------------------- File structure ------------------------------------------------

Ashish Kaushik 1 Mar 1, 2022
Boost.GIL - Generic Image Library | Requires C++11 since Boost 1.68

Documentation GitHub Actions AppVeyor Azure Pipelines CircleCI Regression Codecov Boost.GIL Introduction Documentation Requirements Branches Community

Boost.org 146 Jul 11, 2022
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution

CppServer Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and

Ivan Shynkarenka 867 Aug 8, 2022
A protocol for secure client/server connections over UDP

netcode netcode is a simple connection based client/server protocol built on top of UDP. It has the following features: Encrypted and signed packets S

The Network Protocol Company 2.2k Aug 5, 2022
A protocol for secure client/server connections over UDP

netcode netcode is a simple connection based client/server protocol built on top of UDP. It has the following features: Encrypted and signed packets S

The Network Protocol Company 2.2k Aug 5, 2022
Get fresh version of openssl using prefab dependencies!

OpenSSL static library + prefab Easy to use solution to bake fresh version of OpenSLL into your NDK Library Before you start This package made for usi

ibitcy 4 Dec 10, 2021
websocket and http client and server library, coming with ws, a command line swiss army knife utility

Hello world IXWebSocket is a C++ library for WebSocket client and server development. It has minimal dependencies (no boost), is very simple to use an

Machine Zone, Inc. 329 Aug 8, 2022
C++ websocket client/server library

WebSocket++ (0.8.2) WebSocket++ is a header only C++ library that implements RFC6455 The WebSocket Protocol. It allows integrating WebSocket client an

Peter Thorson 5.7k Aug 10, 2022
Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.

Wangle C++ networking library Wangle is a library that makes it easy to build protocols, application clients, and application servers. It's like Netty

Facebook 2.9k Aug 9, 2022
Simple, secure & standards compliant web server for the most demanding of applications

Simple, secure[1] & standards compliant[2] web server for the most demanding[3] of applications. Read more... ?? Optimized security Being meticulously

uNetworking AB 14.1k Aug 8, 2022
Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services.

Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack.

Fanout 3.1k Aug 4, 2022
To have platform independent network interfaces over usb which is working with Linux, Windows, Mac OS ect.

To have platform independent network interfaces over usb which is working with Linux, Windows, Mac OS ect. called RNDIS. This project is a RNDIS demo, which addtionally implements a http server. It runs out of the box on a stm32f411 BlackPill board. My RNDIS library with an empty template for the second interface (which can ba UART, CAN, ETH or like in this demo a tcp/ip stack) can be found under following link: https://github.com/RDMsmartnetworks/STM32_HAL_RNDIS

Nico Korn 13 Jun 22, 2022
Cross-platform, efficient, customizable, and robust asynchronous HTTP/WebSocket server C++14 library with the right balance between performance and ease of use

What Is RESTinio? RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server. It is based on standalone version of ASIO

Stiffstream 871 Aug 9, 2022