websocket and http client and server library, with TLS support and very few dependencies
Go to file
2019-12-20 15:21:36 -08:00
.github/workflows
CMake (ws) #125 / cmake detects an already installed jsoncpp and will try to use this one if present 2019-12-03 16:01:46 -08:00
docker docker build fixes 2019-10-26 11:47:08 -07:00
docs (tls) add a simple description of the TLS configuration routine for debugging 2019-12-20 15:18:04 -08:00
ixcobra (tls) add a simple description of the TLS configuration routine for debugging 2019-12-20 15:18:04 -08:00
ixcore
ixcrypto
ixsentry (cobra-to-sentry) capture application version from device field 2019-12-18 15:41:59 -08:00
ixsnake (cobra) Add TLS options to all cobra commands and classes. Add example to the doc. 2019-12-19 20:49:28 -08:00
ixwebsocket (tls) add a simple description of the TLS configuration routine for debugging 2019-12-20 15:18:04 -08:00
test (cobra) Add TLS options to all cobra commands and classes. Add example to the doc. 2019-12-19 20:49:28 -08:00
third_party update spdlog 2019-12-06 22:05:12 -08:00
tools Add script to extract the version from the header file and remove DOCKER_VERSION 2019-12-06 16:44:05 -08:00
ws (ws commands) in websocket proxy, disable automatic reconnections + in Dockerfile, use alpine 3.11 2019-12-20 09:51:21 -08:00
.clang-format
.dockerignore
.gitignore update gitignore file 2019-12-20 15:21:36 -08:00
.pre-commit-config.yaml
.travis.yml
appveyor.yml
CMakeLists.txt (ws) #125 / cmake detects an already installed jsoncpp and will try to use this one if present 2019-12-03 16:01:46 -08:00
docker-compose.yml bunch of docker compose dev changes 2019-12-05 15:18:02 -08:00
Dockerfile (ws commands) in websocket proxy, disable automatic reconnections + in Dockerfile, use alpine 3.11 2019-12-20 09:51:21 -08:00
LICENSE.txt
makefile (ws) cobra to sentry - created events with sentry tags based on tags present in the cobra messages 2019-12-11 17:28:11 -08:00
mkdocs.yml
README.md Meta: documentation fixes (#127) 2019-12-03 09:28:18 -08:00
SECURITY.md Create SECURITY.md 2019-10-17 06:58:22 -07:00

Hello world

Build status badge

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 on 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.