websocket and http client and server library, with TLS support and very few dependencies
Go to file
2020-05-21 09:01:50 -07:00
.github/workflows ci / break unittest job into small job files 2020-05-21 09:01:50 -07:00
CMake (third_party deps) fix #177, update bundled spdlog to 1.6.0 2020-04-11 13:32:16 -07:00
docker (ixbots) add new class to configure a bot to simplify passing options around 2020-05-12 19:08:16 -07:00
docs bump version for (compiler fix) support clang 5 and earlier (contributed by @LunarWatcher) #206 2020-05-20 10:58:30 -07:00
ixbots windows build fix with max which is a macro 2020-05-12 21:48:41 -07:00
ixcobra core logger support multiple level + switch ixbots to user corelogger instead of spdlog 2020-04-24 15:17:50 -07:00
ixcore core logger support multiple level + switch ixbots to user corelogger instead of spdlog 2020-04-24 15:17:50 -07:00
ixcrypto Fixes #179 (#180) 2020-04-20 22:59:20 -07:00
ixsentry (cobra bots) do not use a queue to store messages pending processing, let the bot handle queuing 2020-05-04 15:45:11 -07:00
ixsnake core logger support multiple level + switch ixbots to user corelogger instead of spdlog 2020-04-24 15:17:50 -07:00
ixwebsocket bump version for (compiler fix) support clang 5 and earlier (contributed by @LunarWatcher) #206 2020-05-20 10:58:30 -07:00
test (ixbots) add options to limit how many messages per minute should be processed 2020-05-12 21:40:17 -07:00
third_party remove bundled mbedtls 2020-04-25 15:41:39 -07:00
tools (docker) trim down docker image (300M -> 12M) / binary built without symbol and size optimization, and source code not copied over 2020-03-29 13:06:44 -07:00
ws (ixbots) add options to limit how many messages per minute should be processed 2020-05-12 21:40:17 -07: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 update gitignore file 2019-12-20 15:21:36 -08:00
.pre-commit-config.yaml fix #182 2020-04-22 14:26:16 -07:00
appveyor.yml update appveyor file to new directory structure 2019-09-10 12:33:47 -07:00
CMakeLists.txt (cmake) revert CMake changes to fix #203 and be able to use an external OpenSSL 2020-05-20 10:56:58 -07:00
docker-compose.yml bunch of docker compose dev changes 2019-12-05 15:18:02 -08:00
Dockerfile use alpine as the docker distribution 2020-03-27 17:38:35 -07:00
LICENSE.txt First import 2018-09-27 14:57:19 -07:00
makefile (ixbots) add new class to configure a bot to simplify passing options around 2020-05-12 19:08:16 -07:00
mkdocs.yml use default mkdocs theme 2020-04-04 11:05:14 -07:00
README.md ci / break unittest job into small job files 2020-05-21 09:01:50 -07:00
SECURITY.md Create SECURITY.md 2019-10-17 06:58:22 -07:00

Hello world

Build status Build status Build status Build status Build status Build status

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.

Users

If your company or project is using this library, feel free to open an issue or PR to amend this list.

  • Machine Zone
  • Tokio, a discord library focused on audio playback with node bindings.
  • libDiscordBot, a work in progress discord library
  • gwebsocket, a websocket (lua) module for Garry's Mod
  • DisCPP, a simple but feature rich Discord API wrapper