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
19
votes
1 answer

How does WebSockets server architecture work?

I'm trying to get a better understanding of how the server-side architecture works for WebSockets with the goal of implementing it in an embedded application. It seems that there are 3 different server-side software components in play here: 1) the…
Jon
  • 407
  • 1
  • 3
  • 11
17
votes
2 answers

Libwebsocket client example

I am trying to find a example which will explain me how to implement Client using libwebsocket, But I didn't get any convincing code. Is there any link that I can refer to?
vijay jatti
  • 229
  • 1
  • 3
  • 10
17
votes
1 answer

How can I install the libwebsocket library in Ubuntu?

I am trying to install the libwebsocket in my ubuntu . so I downloaded the project https://github.com/warmcat/libwebsockets unzipped it and I followed the installation instruction. I type the command cmake FH and get the following messages. You…
Emb_user
  • 249
  • 1
  • 2
  • 7
6
votes
2 answers

Setting CLion build and binary directory

I'm trying to build libwebsockets inside of my project in CLion. During build libwebsockets creates a header file that is required by other files and puts it in PROJECT_BINARY_DIR. CLion builds everything inside a random build directory it creates…
Huhwha
  • 575
  • 5
  • 15
5
votes
1 answer

How do websockets work in detail?

There's a fantastic answer which goes into detail as to how REST apis work. How do websockets work in the similar detail?
Greg
  • 8,175
  • 16
  • 72
  • 125
5
votes
1 answer

libwebsocket: send big messages with limited payload

I implemented a websocket client in C++ using libwebsocket. I'd like to send big messages, but I limited the message payload to 8K and I need to use that payload value. Here it is a snipped of my initialization…
neoben
  • 743
  • 12
  • 30
5
votes
1 answer

WebSockets work in desktop browsers but fail in Chrome for Android

I've a web app that connects to a service via WebSockets. This app works fine in Chrome/Firefox for desktop, however Chrome for mobile gives the error: WebSocket connection to 'ws://192.168.0.11:8080/' failed: One or more reserved bits are on:…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
4
votes
1 answer

How can I set a user custom pointer in libwebsockets callback?

How can I set a user custom pointer in libwebsockets callback? I added a pointer variable into a lws_protocol. When callback function is called, user pointer is always NULL. I use libwebsockets v3.0. static int interrupted, rx_seen, test; int…
Graham Lee
  • 2,600
  • 5
  • 16
  • 20
4
votes
1 answer

Compiling libuv with libwebsockets

I am trying to run the "libwebsockets-test-server" that is installed with the LWS library, but it will not run because "lwsts[31616]: libuv support not compiled in". I have checked that libuv is installed (1.8.0). I also changed the setting for…
Gordon
  • 317
  • 1
  • 17
4
votes
1 answer

Differences in poll() between Linux and OS X when pollfd is changed on another thread

I'm trying to get libwebsockets running in a multithreaded environment on OS X. I couldn't trigger sending Data from a different thread than the main service thread. On libwebsocket docs it was implied this should be possible (demo code,…
heine
  • 599
  • 5
  • 18
4
votes
2 answers

How to prevent libwebsockets client timeout

I'm trying to create a C++ websocket client using libwebsockets but I can't establish a connection due to it timing out. I've stripped things down for testing and here's what I'm using to establish a connection: Protocols static int…
Huhwha
  • 575
  • 5
  • 15
4
votes
1 answer

How can I build libwebsockets with debug (i.e. -g so I can use gdb)? (I'm getting segfault on libwebsockets function, ssl_ctrl() )

For your reference (because I mention library functions below), libwebsockets documentation can be found here: https://github.com/warmcat/libwebsockets/blob/master/libwebsockets-api-doc.html#L466 Site can be found here:…
Xandrix
  • 494
  • 5
  • 15
3
votes
0 answers

How to compile programs with libwebsockets Library?

I use libwebsockets for a project . I installed it using Packet Manger on debian jessie . It works well , but that packet is old , so I cloned the latest stable version from github . Now when I try to compile programs , i get error message…
3
votes
1 answer

libwebsockets sending websocket close reason

I am using libwebsockets C library for writing a websocket server. According to library documentation, it is mentioned that to close websocket connection from server side we need return -1 in callback. When I did that websocket connection is getting…
Suresh
  • 253
  • 2
  • 4
  • 13
2
votes
2 answers

kismet on raspberry pi failed ./configure libwebsockets

The step before doing the 'make' requires the ./config. It is failing with the following checking for libwebsockets... no configure: error: Package requirements (libwebsockets >= 3.2.0) were not met: Requested 'libwebsockets >= 3.2.0' but version…
markum
  • 119
  • 2
  • 8
1
2 3
10 11