Questions tagged [libwebsockets]

Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources and to provide fast throughput in both directions.

Libwebsocket is a lightweight pure library built to use minimal CPU and memory resources and to provide fast throughput in both directions. It provides server and client APIs for v13 protocol, along with / serving. It can be configured to use or CyaSSL to provide fully encrypted client and server links including client certificate support.

Architectural features like zero-copy for payload data and FSM-based protocol parsers make it ideal for realtime operation on resource-constrained devices. Moreover, its -clean, reliable and robust. It's licensed under LGPL2 +.

You should use this tag if your question is related with Libwebsocket library or its APIs.

161 questions
1
vote
1 answer

Chrome says "Could not decode a text frame as UTF-8" when receiving from libwebsockets

I'm using libwebsockets C library. I'm trying to do a simple echo server, as a test. I'm testing with Firefox and Chrome under linux. The pieces of code are simple : Javascript var ws = new WebSocket ("ws://127.0.0.1:9999", "hephaestus"); ws.onopen…
nschoe
  • 1,967
  • 1
  • 19
  • 26
1
vote
2 answers

libwebsockets write to all active connections after receive

I am toying around with a libwebsockets tutorial trying to make it such that, after it receives a message from a connection over a given protocol, it sends a response to all active connections implementing that protocol. I have used the function…
mikesol
  • 1,177
  • 1
  • 11
  • 20
1
vote
1 answer

Does libwebsockets offer publish/subscribe?

I want to create a web application where a group of users could receive some data asynchronously whenever the C++ backend have something new. So, ideally, when a new user comes, he'll be added to the subscribers list and whenever the C++ backend has…
amine
  • 502
  • 5
  • 14
1
vote
0 answers

libwebsockets with openssl seems slow when return a picture from server

I'm using libwebsockets to develop a small service for connection between browser and my service. When it work in http, everything is ok. But when I switch to https with openssl, it works bad. For example, when I click a hyperlink in browser, my…
Jeremy Chen
  • 101
  • 1
  • 3
1
vote
0 answers

Error Message in Google Chrome WebSocket extension "x-webkit-deflate-frame" is deprecated

I am using JavaScript to connect to a websocket. I am seeing an error message in the JavaScript console of google Chrome 33.0.1750.117. The error occurs on the following line of JavaScript: ws = new WebSocket("ws://*.*.*.*", "sub_protocol"); This…
BrightIntelDusk
  • 4,577
  • 2
  • 25
  • 34
0
votes
0 answers

When using the libwebsocket library, how to correctly use client_ssl_ca_mem to pass multiple

Brief description of the problem. When using the libwebsockets library, when multiple CA root certificates are passed using client_ssl_ca_mem, the order of the CA root certificates affects the certificate verification process and may result in…
0
votes
0 answers

libwebsockets - compresssion (deflate)

I'm trying to figure out how to enable deflate compression on the client with libwebsockets, for both send and receive. Documentation seems sparse, I understand that I'd need to: Configure lws with LWS_WITH_HTTP_STREAM_COMPRESSION Use…
0
votes
0 answers

I am trying to find the size of data sent after compression in libwebsockets from client. How can i achieve it?

How can I determine the size of data being sent after compression in libwebsocket. I tried getting stats about size of data after compression from libwebsocket metrics but did not find one. How can I achieve this from libwebsocket?
Sh55
  • 1
0
votes
1 answer

How to proxy websocket and http over lighttpd to different ports?

I have 2 separate applications. One is based on libwebsockts which works on port 8081 and the other based on libmicrohttpd which runs on port 8080. Both of these services run on localhost. What I am trying to do is to use lighttpd with mod_proxy to…
0
votes
1 answer

Binance Futures with libwebsockets is not working

I'm making a C++ application that would get the price information from Binance Futures via WebSockets. To achieve my goal I use Yair Gadelov's websockets wrapper project, which is based on libwebsockets. This article tells how to use this wrapper:…
Tiberius
  • 29
  • 5
0
votes
0 answers

libwebsocket not callbacking with LWS_CALLBACK_PROTOCOL_INIT after lws_create_context

I'm using lws-minimal-ws-broker example to make a broker over websocket. I'm facing few issues I cannot find answers to: Firstly, callback_minimal is never called with reason LWS_CALLBACK_PROTOCOL_INIT. Thos results protocol init related code is…
0
votes
0 answers

libwebsockets error loading javascript .js file

I am writing a small server on libwebsockets. The server uses mountpoint to serve static files. All files load fine from it except .js. In chrome it shows the following error: GET http://127.0.0.1:8000/display.js net::ERR_CONTENT_LENGTH_MISMATCH 200…
0
votes
0 answers

Libwebsockets client can not connect to Socket.IO server

I'm trying to create a client using Libwebsockets library to connect to Socket.IO server. But client show error on console screen as below: [2023/03/09 15:52:15:0950] N: lws_create_context: LWS: 4.3.2-unknown, NET CLI SRV H1 H2 WS ConMon…
Don Le
  • 1
  • 1
0
votes
0 answers

facebook dispenso multithreading/tasking synchronization integration with boost beast asio web sockets?

I try to build an ultra-simple stable and fast C++ concurrent web-sockets project. I stumbled on the boost::beast project, integrated the Hello World sample. While starting to dig into the code and trying to understand how to implement a sample…
0
votes
0 answers

how to innovate boost beast .../gcc-11/debug/cxxstd-2a-iso/threading-multi/visibility-hidden/advanced-server-flex-awaitable?

I built the boost 1.81.0 library, then compiled boost::beast on Linux Ubuntu 22.04 with c++20 (cxxstd 2a). out of this library I wish to learn how to work with 100% (almost) CPU-s on multiple web-sockets. can you help me innovate/modify the code to…