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

libwebsockets for C, can i use websocket file descriptor with select()?

I am coding with libwebsockets for client which is websocket library for C. And i want to use websocket file descriptor with select() so that i can handle websocket while handling other events. and then only if websocket got an event, i can call…
SangminKim
  • 8,358
  • 14
  • 69
  • 125
1
vote
0 answers

How to fix CLIENT_CONNECTION_ERROR: tls: error:00000001:lib(0):func(0):reason(1) [libwebsockets][IBM Watson Text to Speech]

I'm trying to connect to IBM Watson Text to Speech API's Websocket using libwebsockets. I based my code on a simple websocket client found on iamscottmoyers / simple-libwebsockets-example / client.c. I added support for SSL but I'm getting the…
Paiku Han
  • 581
  • 2
  • 16
  • 38
1
vote
0 answers

Building libwebsockets for OP-TEE

I've been trying to build libwebsockets for OP-TEE running on a TI AM437x HS (an arm platform). I'm using Yocto to build; here's the version string for OP-TEE, which is displayed on boot: I/TC: OP-TEE version: ti2019.05-rc1-dev (gcc version 8.3.0…
1
vote
0 answers

libwebsockets throws CLIENT_CONNECTION_ERROR: Unable to connect when performing Ping operation

I have sort of hit a dead end. Can someone please help. I have never used libwebsockets before. I have an RPI4(Installed Ubuntu 22.04), where my code is running which tries to ping my Laptop(Windows 10). Both are on same Wi-Fi network. I am able to…
ashutosh
  • 79
  • 3
  • 8
1
vote
0 answers

Encode and decodd WebSocket with Python

How can I encode and decode WebSocket with Python? Not only Ascii encoding. I didn't any solution for that. Is there any build-in library that can do that?
Kokomelom
  • 143
  • 1
  • 10
1
vote
3 answers

How to use C library installed with vcpkg on linux?

I'm trying to install libwebsockets C library with vcpkg according to the instruction. And don't understand something. OS - Ubuntu 20.04 git clone https://github.com/microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg install…
tehkonst
  • 185
  • 2
  • 8
1
vote
2 answers

Where is the implementation of lws_json_dump_vhost in the libwebsockets library

I got the code of libwebsockets from https://github.com/warmcat/libwebsockets.git. And I found that there is a declaration of the function lws_json_dump_vhost in the lws-context-vhost.h file, but I did not found the implementation of…
leon.zhou
  • 11
  • 1
1
vote
2 answers

How do I create a websocket connection in Python?

I am trying to create a websocket connection with following code (just to make a test connection): async def webSocket(): async with websockets.connect("wss://push1-v2.kucoin.com") as test: await test.send("/api/v1/bullet-public") result =…
Aboji
  • 35
  • 4
1
vote
1 answer

Libwesockets: how to read text (json) data properly from websocket?

I have such websocket implementation and it worked before but now it doesn't because I upgraded library version. int Handle(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len) { switch( reason ) { …
xercool
  • 883
  • 1
  • 8
  • 24
1
vote
2 answers

How to avoid sub-library aggregation during webrtc compilation on Windows?

I'm trying to compile and use static WebRTC against OpenSSL 1.1.1 on Windows in a Visual Studio project, here's my gn line : gn gen ./intermediate --args="target_cpu=\"x64\" use_rtti=false is_debug=true symbol_level=2 enable_iterator_debugging=true…
SamT
  • 528
  • 4
  • 14
1
vote
1 answer

'HMAC_CTX' has incomplete type

I'm trying to compile a C++ project on Fedora 31 and I receive this error: [ 66%] Building CXX object proxy_ws/CMakeFiles/proxy_lws.dir/proxy_lws.cpp.o In file included from /vagrant/include/libwebsockets.h:600, from…
doctopus
  • 5,349
  • 8
  • 53
  • 105
1
vote
2 answers

Libwesockets.h: Issue with lws_write: C++ string to C conversion and send

I'm using g++. Code: std::string str = "{\"action\":3,\"data\":{\"account\":\"somehashgoeshear\",\"someint\":0,\"id\":1,\"moreint\":0,\"name\":\"demo\"}}"; char *cstr = strdup(str.c_str()); lwsl_notice("\n%s", cstr); …
xercool
  • 883
  • 1
  • 8
  • 24
1
vote
0 answers

Using libwebsockets with LWS_ROLE_WS

I compiled libwebsockets using: cmake make all sudo make install ldconfig I'm trying to compile an example, but CMake gives the error that lws must have been configured with LWS_ROLE_WS. I cannot work out how to 'create' lws with that option. I'm…
1
vote
1 answer

How to compiling static libwebscocket.a

I'd to compiling my application with using the libwebsockets.a instead of the libwebsocket.so but i have some problems. i think there is a lack of link but i don't find what library lacking. My code compile and works on the Raspberry Pi with Raspian…
meso
  • 21
  • 3
1
vote
0 answers

lws_write will change the row source buffer?

I tried send data by lws_write, but I find the buffer has been changed when it returns. INFO("Now write head data %d",n); lwsl_hexdump_notice(pstPosTmp->data, pstPosTmp->len); n = lws_write(wsi,pstPosTmp->data +…
jiamu
  • 21
  • 3
1 2
3
10 11