Libwebsockets

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • libwebsockets

    canonical libwebsockets.org networking library

  • This is just the endemic result of C++ lacking a package manager.

    Every library starts out small, adds its own vendored utilities, adds its own dependencies, and eventually becomes boost.

    To be fair to this project, theyve worked quite hard to make the library consumable by others… but yes, its hard to look at the code like https://github.com/warmcat/libwebsockets/blob/50ba61082dc40b...

    …and not go… really? As part of the core of libwebsocket?

    When you read the justification it’s mostly “well we have a good framework now, so why not use it for other things too?”

    C++ life.

    /shrug

  • cosmopolitan

    build-once run-anywhere c library

  • FWIW there is ongoing work with good progress to add websocket support to redbean (https://github.com/jart/cosmopolitan/pull/967)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • This looks promising: https://gitlab.com/eidheim/Simple-WebSocket-Server

    It includes http/https/ws/wss client and server code in just a few files (although last I checked, some files are needlessly duplicated in 2 different repos).

  • wsServer

    wsServer - a tiny WebSocket server library written in C (by Theldus)

  • One great feature for me was being able to accept both WebSocket as well as raw TCP connections on the same port using libwebsockets, this is extremely easy and just required settings the flag LWS_SERVER_OPTION_FALLBACK_TO_RAW.

    I encountered other hiccups. They are fully documented and completely valid, but were really confusing to me as a first-time user:

    * Sending data requires a specific memory layout[2] – namely having to allocate memory for the websocket header youself before the actual message you want to send. This gave me confusing segfaults in the beginning.

    * Sending data / responding to a client message will probably (but not always) fail when just naively using "lws_write()". To correctly send data you need to manually queue your message data, request the "ON_WRITABLE" callback[3] and only then actually send.

    [1]: https://github.com/Theldus/wsServer

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts