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

Save audio stream in file using C libwebsockets

I have a C server that uses libwebsockets and I want to save a received audio stream in a file on disk. Here is my code snippet: #define FILENAME "/home/ubuntu/Desktop/file.wav" FILE *received_file; struct lws_context *Audiocontext; static…
1
vote
1 answer

Install Mosquitto with websockets in Ubuntu?

I am following this tutorial to set up Mosquitto with libwebsockets in Ubuntu server (Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64))at Amazon EC2. When I try to set up this specific version (v1.4 supported by Mosquitto) of Libwebsockets,…
Shah Abaz Khan
  • 565
  • 4
  • 21
1
vote
0 answers

Combining libwebsockets with normal sockets using poll() - SSL connection overhead?

I have a single-threaded AIX server that polls multiple sockets and a message queue all using the poll() function (AIX has that neat feature of poll handling both, and it works well with ~1000 sockets). I'm wondering if it'd be a bad idea to add…
littlenoodles
  • 435
  • 4
  • 13
1
vote
0 answers

why is the ping on localhost so high when i use websockets?

I am using a simple node.js server to broadcast messages: var ws = require('websocket.io'); var server = ws.listen(3000); server.on('connection', function(socket) { socket.on('message', function(data) { …
badmonkee
  • 19
  • 2
1
vote
1 answer

Compiling in c: include file not found

I got following error 'libwebsockets.h' file not found but I have installed libwebsockets with the command brew install libwebsockets How can I solve this error? I want to implement a websocketserver and i need this. If my code is only has this…
1
vote
1 answer

Reconnect websocket client written in C

I have a websocket client, written in C with libwebsockets library. For tests I am using simple-websocket-server in chat mode. $ python SimpleExampleServer.py —example chat How can I write reconnection of client when happens a disconnect with…
1
vote
2 answers

Under libwebsockets, how to receive message bigger than 4096 on server side?

I have create a websocket server with libwebsockets library, and the protocol list is like this: /* List of supported protocols and callbacks. */ static struct libwebsocket_protocols protocols[] = { { "plain-websocket-protocol" /* Custom name.…
Dr.Nemo
  • 1,451
  • 2
  • 11
  • 15
1
vote
1 answer

Libwebsockets libwebsocket_client_connect function parameters

This is the signature of libwebsocket_client_connect() struct libwebsocket * libwebsocket_client_connect( struct libwebsocket_context * context,  const char * address, int port, int ssl_connection, const char *path,  const char * host, const char…
RAVI
  • 11
  • 2
1
vote
2 answers

How to use opensource C library in Visual C++

I was trying to use a c library libwebsockets(https://github.com/warmcat/libwebsockets) for my c++ program. I followed the manual and it creates a visual studio solution and it works. Since I am not used to develop a program on a windows 7 visual…
Peter Hwang
  • 971
  • 1
  • 12
  • 25
1
vote
1 answer

Jetty WebSocket Client Doesn't work for Binary Listener

I have a Java app that uses the Jetty WebSocket Client, version 9.x. It works fine for text messages sent from the server, but the binary listener is never invoked. I have a Javascript client implementation which I'm basically duplicating. I'm doing…
MidnightJava
  • 1,927
  • 2
  • 18
  • 38
1
vote
0 answers

How to get ping interval in libwebsocket?

I am using libwebsocket as client to communicate with socketIO. I want to keep my connection alive by sending ping packet. I know during protocol negotiation we get ping interval and ping timeout. But I am failing to find it in libwebsocket context.…
axay
  • 21
  • 3
1
vote
2 answers

libwebsockets: how to store IP address with request

I'm struggling to understand how I'm supposed to capture the client IP address when using libwebsockets as a server. From what I understand of the documentation, libwebsockets_get_peer_addresses is only available for use in the…
GMemory
  • 137
  • 9
1
vote
1 answer

calling libwebsockets server from TooTallNate/Java-Websockets fails

I have implemented a websockets server in C++ with libwebsockets. It works when I make calls from any web browser using or not TLS. When I call it from an android app using TooTallNate/Java-Websockets library it works if the server doesn't use a…
juanjo75es
  • 253
  • 1
  • 3
  • 15
1
vote
1 answer

C websocket library, libwebsockets

I am looking through C websocket library libwebsockets client side example. But i don't understand what the example purpose is. Here is the example, this example have two connection (in the code wsi_dumb and wsi_mirror)which are same i think, and i…
SangminKim
  • 8,358
  • 14
  • 69
  • 125
1
vote
1 answer

Websocket connection error with HiveMQ 2.1.0 + Eclipse Paho javascript mqttws31.js

I am facing the below error when executing the mqttws31.js as part of a HTML file on Google Chrome. HiveMQ was used as MQTT broker, logs are as below 2014-10-28 14:46:45,043 INFO - HiveMQ home directory: E:\hivemq-2.1.0 2014-10-28 14:46:45,065…
Sudhi
  • 229
  • 3
  • 4
  • 13