websocket and http client and server library, with TLS support and very few dependencies
Go to file
2019-11-28 15:17:13 -08:00
.github/workflows add gihub actions 2019-09-22 18:45:30 -07:00
CMake - mbedtls and zlib are searched with find_package, and we use the vendored version if nothing is found 2019-06-10 11:18:27 -07:00
docker docker build fixes 2019-10-26 11:47:08 -07:00
docs ws cobra subcommands / channel is not a positional argument anymore 2019-11-28 15:17:13 -08:00
ixcobra Add client support for websocket subprotocol. Look for the new addSubProtocol method for details 2019-10-13 13:37:34 -07:00
ixcore restructure project 2019-09-10 12:19:22 -07:00
ixcrypto speedup base64 code by reserving memory 2019-09-24 14:17:03 -07:00
ixsentry (http client) Add support for multipart HTTP POST upload + (ixsentry) Add support for uploading a minidump to sentry 2019-11-25 21:11:11 -08:00
ixsnake proxy works but crash when the connection is refused 2019-11-15 17:07:31 -08:00
ixwebsocket (http client) Add support for multipart HTTP POST upload + (ixsentry) Add support for uploading a minidump to sentry 2019-11-25 21:11:11 -08:00
test tweaks to the test python proxy code / (moved here) https://gist.github.com/bsergean/bad452fa543ec7df6b7fd496696b2cd8 2019-11-20 11:32:21 -08:00
third_party fix windows compile error in include/spdlog/details/pattern_formatter-inl.h 2019-09-29 22:00:57 -07:00
ws ws cobra subcommands / channel is not a positional argument anymore 2019-11-28 15:17:13 -08:00
.clang-format update clang format file 2019-09-10 22:17:08 -07:00
.dockerignore fix cobra to sentry + change ws docker file to use alpine (much smaller footprint) 2019-05-31 00:43:22 -07:00
.gitignore New option to cap the max wait between reconnection attempts. Still default to 10s. (setMaxWaitBetweenReconnectionRetries) (#108) 2019-08-30 12:46:35 -07:00
.pre-commit-config.yaml update pre-commit file 2019-09-10 22:18:16 -07:00
.travis.yml ci 2019-09-05 22:32:54 -07:00
appveyor.yml update appveyor file to new directory structure 2019-09-10 12:33:47 -07:00
CMakeLists.txt fix android build + proxy work 2019-11-16 06:51:53 -08:00
DOCKER_VERSION (http client) Add support for multipart HTTP POST upload + (ixsentry) Add support for uploading a minidump to sentry 2019-11-25 21:11:11 -08:00
docker-compose.yml add doc about using ws to run a cobra server/publisher/subscriber 2019-11-27 09:26:45 -08:00
Dockerfile add a python websocket proxy which works on Linux, while ws proxy_server does not 2019-11-18 13:46:11 -08:00
LICENSE.txt First import 2018-09-27 14:57:19 -07:00
makefile add a python websocket proxy which works on Linux, while ws proxy_server does not 2019-11-18 13:46:11 -08:00
mkdocs.yml Add md doc made with mkdocs 2019-08-26 21:25:45 -07:00
README.md Update README.md 2019-11-23 12:44:24 -08:00
SECURITY.md Create SECURITY.md 2019-10-17 06:58:22 -07:00

Hello world

Alt text

IXWebSocket is a C++ library for WebSocket client and server development. It has minimal dependencies (no boost), is very simple to use and support everything you'll likely need for websocket dev (SSL, deflate compression, compiles on most platforms, etc...). HTTP client and server code is also available, but it hasn't received as much testing.

It is been used on big mobile video game titles sending and receiving tons of messages since 2017 (iOS and Android). It was tested on macOS, iOS, Linux, Android, Windows and FreeBSD. Two important design goals are simplicity and correctness.

# Required on Windows
ix::initNetSystem();

# Our websocket object
ix::WebSocket webSocket;

std::string url("ws://localhost:8080/");
webSocket.setUrl(url);

// Setup a callback to be fired (in a background thread, watch out for race conditions !)
// when a message or an event (open, close, error) is received
webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg)
    {
        if (msg->type == ix::WebSocketMessageType::Message)
        {
            std::cout << msg->str << std::endl;
        }
    }
);

// Now that our callback is setup, we can start our background thread and receive messages
webSocket.start();

// Send a message to the server (default to TEXT mode)
webSocket.send("hello world");

Interested ? Go read the docs ! If things don't work as expected, please create an issue in github, or even better a pull request if you know how to fix your problem.

IXWebSocket is actively being developed, check out the changelog to know what's cooking. If you are looking for a real time messaging service (the chat-like 'server' your websocket code will talk to) with many features such as history, backed by Redis, look at cobra.

IXWebSocket client code is autobahn compliant beginning with the 6.0.0 version. See the current test results. Some tests are still failing in the server code.