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
2
votes
2 answers

Send WebSockets message to server

I am trying to work with an API of one device, but it is using a WS interface with enforced Origin header, which is giving me troubles. In Chrome, I can open the Console while a page with the correct Origin is loaded, create the WS connection, and…
programagor
  • 288
  • 4
  • 12
2
votes
1 answer

Installing/Linking libwebsockets library in AWS Linux for mosquitto MQTT

Following the AWS Guide: https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/ and I got to the step that has me install mosquitto. //Update the list of repositories with one containing Mosquitto sudo wget…
2
votes
0 answers

How do you accept websocket connection with libwebsockets?

All the examples found on warmcat/libwebsockets are all about accepting http requests and serving webpage/files. I am trying to do a websocket connection, ex: ws://123.0.0.1/blah however it won't ever establish the connection properly. I am using…
codenamezero
  • 2,724
  • 29
  • 64
2
votes
1 answer

Unable to connect to Mosquitto over Websocket

I am unable to connect to my local Mosquitto 1.4.10 broker from a JavaScript client over a Websocket. The same JavaScript client is successfully connecting to the public broker at test.mosquitto.org on port 8080 over a Websocket. The MQTT protocol…
Manav
  • 21
  • 1
  • 4
2
votes
1 answer

libwebsockets client fails to connect

I'm using libwebsockets 2.0 and I'm having a few issues trying to connect to a server using it as a client. According to the libwebsockets log, this is what happens when my fairly simple client tries to connect to echo.websocket.org: [2016/09/25…
2
votes
0 answers

How to apply TLS in Mosquitto with websockets?

I'm tring to test mosquitto+websocket broker. My website that include mqtt-javacript use https, so i have to use wss:// protocol So first I apply to broker TLS option(cafile, certfile, key), and it worked well.(not websockets) But when i add…
sexyjoon
  • 21
  • 2
2
votes
0 answers

How to make libwebsockets use kqueue() system call internally instead of _poll()?

SO FAR: 1- I have a native application that uses libwebsocket server to communicate to a browser(websockets client). 2- I see a HIGH CPU usage(activity monitor indicates 100% usage in a 4 core mac machine- Yosemite(10.10.4)) when the app is…
2
votes
1 answer

Creating CMake project for libwebsocket

The title states the problem statement: I'm trying to create a CMake project utilizing the libwebsocket library, but I can't find any information for doing so. Is there anyone who have tried this? A simple CMakeLists.txt for e.g. the test-server…
2
votes
1 answer

Enabling mosquitto over websocket in windows

I have built mosquitto on Visual Studio with websockets enabled, using Cmake to generate the project files. I used libwebsockets-1.4 . I ran this broker with a websocket listener, and as following image it started listening on port 8000 through…
Dhanushka Dolapihilla
  • 1,115
  • 3
  • 17
  • 34
2
votes
2 answers

libwebsocket: unable to write frame bigger than 7160 bytes

I'm addressing an issue with WebSocket that I'm not able to understand. Please, use the code below as reference: int write_buffer_size = 8000 + LWS_SEND_BUFFER_PRE_PADDING + LWS_SEND_BUFFER_POST_PADDING; char…
neoben
  • 743
  • 12
  • 30
2
votes
0 answers

How to compile libwebsockets for MQTT (mosquitto broker) in windows Machine?

I am working in a Hybrid App development. I would like to implement MQTT service in my app. I heard JavaScript supports only websocket protocol to communicate with MQTT broker. For that libwebsocket is required, But, I couldn't get any explanation…
Roney Francis
  • 356
  • 2
  • 15
2
votes
1 answer

How to send data from a C program to a websocket using libwebsockets without using the callback function?

For a project we're using the libwebsockets to communicate to a webserver. The problem is that we can only send data from the C program to the webserver when we received data, and we can't send data at any moment we want to. Is there any way to send…
T J
  • 121
  • 4
2
votes
2 answers

libwebsocket send payload limitation

I'm having libwebsocket client to send binary data. I've saved my binary data into a buffer [i.e. buf] and writing to socket. n = libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], l, opts | LWS_WRITE_BINARY); My problem is socket is…
Pushpa
  • 892
  • 1
  • 12
  • 30
2
votes
2 answers

Unable to send data to libwebsocket server

I'm trying to write a small plugin for X-Plane, to create a simple websocket server with libwebsocket. I'm able to connect to the websocket from Google Chrome, however, when I send data to the server, X-Plane immediately crashes. I'm pretty certain…
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
2
votes
4 answers

Using libwebsockets + ssl in asterisk getting error creating ssl context 140A90A1:lib(20):func(169):reason(161)

We are using libwebsockets 1.3 in our ssl enabled web socket client program written in c, we are compiling on Centos 6.5 with openssl 1.0.1 installed, making a .so library which is later used in asterisk. The compilation goes fine but I'm getting…
nobody
  • 10,599
  • 4
  • 26
  • 43
1
2
3
10 11