TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Libwebsockets a powerful and lightweight pure C library

257 pointsby khoobid_shomaover 3 years ago

12 comments

ncannover 3 years ago
I have used this library before, it's a powerful library indeed but the documentation is a bit lacking. There isn't a straightforward guide to do the most common operations, even the most simple ones like connecting a client to a server, and you're left with studying the various examples provided, each of them do things a little differently. There are also a lot of undocumented functions/constants/structs.
评论 #28443312 未加载
评论 #28441897 未加载
评论 #28447814 未加载
评论 #28442984 未加载
PaulDavisThe1stover 3 years ago
We use libwebsockets in Ardour (a cross-platform digital audio workstation) to provide the ability to create control surfaces (GUIs) within the browser. We mostly treat it as a transport layer for OSC messages, which could otherwise be transferred via UDP (if the endpoint wasn't a browser).
评论 #28441214 未加载
porsagerover 3 years ago
How does this fare compared to uWebSockets? <a href="https:&#x2F;&#x2F;github.com&#x2F;uNetworking&#x2F;uWebSockets" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;uNetworking&#x2F;uWebSockets</a>
评论 #28451040 未加载
评论 #28443245 未加载
评论 #28447487 未加载
评论 #28443693 未加载
willbuddover 3 years ago
I wrote something similar, except instead of providing a library (which Libwebsockets already does a fine job of), I created a server&#x2F;framework accepting shared objects as backend plugins running as dedicated threads interacting with spsc lockless ringbuffers. In other words, more or less the inverse of a library: <a href="https:&#x2F;&#x2F;github.com&#x2F;wbudd&#x2F;ringsocket" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wbudd&#x2F;ringsocket</a><p>I haven&#x27;t been putting much time into it anymore lately, but I intend to create a bunch of language bindings for it soon so you can write plugins in other languages too such as Python, C++, Rust, etc. Should be interesting.
Subsentientover 3 years ago
I personally prefer QtWebSockets. I&#x27;ve used libwebsockets before, but I found the API error prone and crusty, and ended up eventually converting it to QWebSockets. That turned out to be a good move.
fasteoover 3 years ago
Not a library [1], but trivial to integrate in your architecture. Just redirect stdout to gwsocket<p>[1] <a href="https:&#x2F;&#x2F;gwsocket.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gwsocket.io&#x2F;</a>
baybal2over 3 years ago
I remember hearing about it many years ago, and am surprised to find it alive, and well now.<p>I always felt that the web people were never about performance, since there were many &quot;pure C&quot; webdev attempts before without much success.<p>Nginx can very realistically handle 1-2M requests per minute on commodity hardware, and no customisation, and that&#x27;s from the disk.<p>Were somebody really serious about web performance, I think going from millions of requests per minute, to millions of requests per second is 100% possible.<p>I worked on this problem around 6 years ago, when I had a task of squeezing HTTP, and network perf on some API servers close to hardware limits. The task was mostly about gluing DPDK to popular software: nginx, memcached, postgres.<p>I am very enthusiastic to see Libwebsockets getting glib support. Glib is a one of a kind piece of software in the C ecosystem with which you can adopt modern programming methods, and in general approach it as you do it in a big &quot;platform&quot; like environment like NODEJS. Glib is really undeserving neglected, and overlooked.
评论 #28441610 未加载
评论 #28440889 未加载
评论 #28441815 未加载
评论 #28441157 未加载
iFireover 3 years ago
I wish there was something like this for WebRTC data channels.
评论 #28441365 未加载
评论 #28440949 未加载
dpflanover 3 years ago
Has anyone used this in a multithreaded implementation, and how is&#x2F;was the experience?
评论 #28439817 未加载
评论 #28441470 未加载
评论 #28441047 未加载
mkl95over 3 years ago
How does performance compare to a C&#x2F;C++ UDP implementation?
unquietcodeover 3 years ago
This really needs to be a system library; I&#x27;m rooting for it.
seaniebover 3 years ago
When will people stop writing C? The memory safety issues make go, rust etc. much better solutions.
评论 #28443321 未加载
评论 #28445177 未加载
评论 #28452697 未加载
评论 #28442731 未加载