All Projects → machinezone → Ixwebsocket

machinezone / Ixwebsocket

Licence: bsd-3-clause
websocket and http client and server library, coming with ws, a command line swiss army knife utility

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Ixwebsocket

Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+1488.73%)
Mutual labels:  websockets, websocket-server, websocket-client, http-server
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (-86.76%)
Mutual labels:  websocket-server, websockets, websocket-client, http-server
LazWebsockets
Websocket Server and Client Library written in Lazarus
Stars: ✭ 51 (-75%)
Mutual labels:  websocket-server, websockets, websocket-client
Fs2 Http
Http Server and client using fs2
Stars: ✭ 132 (-35.29%)
Mutual labels:  websockets, websocket-client, http-server
Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (-42.65%)
Mutual labels:  websockets, websocket-server, websocket-client
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (-49.51%)
Mutual labels:  websocket-server, websockets, http-server
EthernetWebServer
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…
Stars: ✭ 118 (-42.16%)
Mutual labels:  websockets, websocket-client, http-server
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+1725.49%)
Mutual labels:  websockets, websocket-server, websocket-client
Cowboy
Small, fast, modern HTTP server for Erlang/OTP.
Stars: ✭ 6,533 (+3102.45%)
Mutual labels:  websockets, websocket-server, http-server
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+338.73%)
Mutual labels:  websocket-server, websocket-client, http-server
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+1544.61%)
Mutual labels:  websocket-server, websocket-client, http-server
Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (+520.1%)
Mutual labels:  websockets, websocket-server, websocket-client
text
An experiment with WebSockets and the human condition.
Stars: ✭ 51 (-75%)
Mutual labels:  websocket-server, websockets, websocket-client
reactive-streams-for-java-developers
No description or website provided.
Stars: ✭ 16 (-92.16%)
Mutual labels:  websocket-server, websockets, websocket-client
Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (+320.59%)
Mutual labels:  websockets, websocket-server, websocket-client
Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+1604.41%)
Mutual labels:  websockets, websocket-server, websocket-client
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+226.47%)
Mutual labels:  websockets, websocket-server, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+316.67%)
Mutual labels:  websockets, websocket-server, websocket-client
Jiny
Lightweight, modern, simple JVM web framework for rapid development in the API era
Stars: ✭ 40 (-80.39%)
Mutual labels:  websocket-server, websocket-client, http-server
Sketchpad
Sketchpad is fully customisable collaborative whiteboard plugin written in pure JavaScript.
Stars: ✭ 85 (-58.33%)
Mutual labels:  websocket-server, websocket-client

Hello world

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. Note that the MinGW compiler is not supported at this point. Two important design goals are simplicity and correctness.

A bad security bug affecting users compiling with SSL enabled and OpenSSL as the backend was just fixed in newly released version 11.0.0. Please upgrade ! (more details in the https://github.com/machinezone/IXWebSocket/pull/250.

/*
 *  main.cpp
 *  Author: Benjamin Sergeant
 *  Copyright (c) 2020 Machine Zone, Inc. All rights reserved.
 *
 *  Super simple standalone example. See ws folder, unittest and doc/usage.md for more.
 *
 *  On macOS
 *  $ mkdir -p build ; (cd build ; cmake -DUSE_TLS=1 .. ; make -j ; make install)
 *  $ clang++ --std=c++11 --stdlib=libc++ main.cpp -lixwebsocket -lz -framework Security -framework Foundation
 *  $ ./a.out
 */

#include <ixwebsocket/IXNetSystem.h>
#include <ixwebsocket/IXWebSocket.h>
#include <iostream>

int main()
{
    // Required on Windows
    ix::initNetSystem();

    // Our websocket object
    ix::WebSocket webSocket;

    std::string url("wss://echo.websocket.org");
    webSocket.setUrl(url);

    std::cout << "Connecting to " << url << "..." << std::endl;

    // 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 << "received message: " << msg->str << std::endl;
                std::cout << "> " << std::flush;
            }
            else if (msg->type == ix::WebSocketMessageType::Open)
            {
                std::cout << "Connection established" << std::endl;
                std::cout << "> " << std::flush;
            }
        }
    );

    // 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");

    // Display a prompt
    std::cout << "> " << std::flush;

    std::string text;
    // Read text from the console and send messages in text mode.
    // Exit with Ctrl-D on Unix or Ctrl-Z on Windows.
    while (std::getline(std::cin, text))
    {
        webSocket.send(text);
        std::cout << "> " << std::flush;
    }

    return 0;
}

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.

Starting with the 11.0.8 release, IXWebSocket should be fully C++11 compatible.

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, an easy to use Discord-bot framework.
  • gwebsocket, a websocket (lua) module for Garry's Mod
  • DisCPP, a simple but feature rich Discord API wrapper
  • discord.cpp, a discord library for making bots
  • Teleport, Teleport is your own personal remote robot avatar

Alternative libraries

There are plenty of great websocket libraries out there, which might work for you. Here are a couple of serious ones.

uvweb is a library written by the IXWebSocket author which is built on top of uvw, which is a C++ wrapper for libuv. It has more dependencies and does not support SSL at this point, but it can be used to open multiple connections within a single OS thread thanks to libuv.

To check the performance of a websocket library, you can look at the autoroute project.

Continuous Integration

OS TLS Sanitizer Status
Linux OpenSSL None Build2
macOS Secure Transport Thread Sanitizer Build2
macOS OpenSSL Thread Sanitizer Build2
macOS MbedTLS Thread Sanitizer Build2
Windows Disabled None Build2
UWP Disabled None Build2
Linux OpenSSL Address Sanitizer Build2
  • ASAN fails on Linux because of a known problem, we need a
  • Some tests are disabled on Windows/UWP because of a pathing problem
  • TLS and ZLIB are disabled on Windows/UWP because enabling make the CI run takes a lot of time, for setting up vcpkg.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].