58 questions
1
vote
2
answers
217
views
Bun with uWebSockets -- node version error on Linux
Gentoo Linux. Node v22.13.1.
bun --watch ./uws/uws.js
17 |
18 | module.exports = (() => {
19 | try {
20 | return require('./uws_' + process.platform + '_' + process.arch + '_' + ...
0
votes
1
answer
141
views
The memory doesn't seem to be freed when deleting an object allocated in the heap. What am I missing here? [closed]
Whenever a new client connects, a new std::string instance is created in heap inside the .message callback and set with a value sent by the client (the message object).
I can see the memory (RSS tab) ...
1
vote
1
answer
529
views
How to create a websocket server/client using the uwebsocket lib?
I'm tyring to create a minimal example of a server/client using the uwebsocket lib.
On my attempt below the server is getting on, it outputs "Server listening on port 9001", but the client ...
0
votes
2
answers
287
views
cmake Link to OpenSSL failing undefined reference to openssl functions
I'm trying to build a project which links to openssl Using CMake. I'm getting errors at the linking stage. One of the shared libraries cannot find certain openssl functions even tho that shared ...
0
votes
1
answer
115
views
no instance of function template "uWS::CachingApp<SSL>::ws [with SSL=false]" matches the argument list, uWebSockets
I've been trying for hours to make the uWebSockets library work but I have no clue now. When using this code:
#include <App.h>
struct UserData {
};
int main() {
uWS::App().ws<UserData&...
0
votes
1
answer
311
views
uWebSockets C++ error on send(): cork buffer must not be acquired without checking cancork
I'm developing a websoscket server for an embedded system. The requirements are very simple: send updates to a list of signals ids the webapp subscribes to. Everything works fine until the crash ...
2
votes
0
answers
241
views
Correct way to build uwebsocket dependencies on windows 11 for MinGW?
My project structure is as follows
uwebsockets/ (git-submodule)
- src
- uSockets
- boringssl
- ...
- lsquic
- ...
- ...
- examples
- ...
- ...
entry.cpp
src/
- ....
5
votes
0
answers
2k
views
boost::beast vs uwebsockets library performance c++
I'm porting a python application over to C++. As I'm not incredibly familiar with C++ I was wondering if there are any benchmark test result out there for websocket latency between the two libraries ...
1
vote
1
answer
719
views
How do I periodically send data over a websocket with uWebSockets and C++?
uWS::App::WebSocketBehavior<data> WebSocketBehavior;
WebSocketBehavior.open = [](uWS::WebSocket<false, true, data> *ws)
{
};
After opening a websocket, I want ...
0
votes
1
answer
479
views
Websocket disconnects and connects every 30 seconds + sends messages randomly
Screenshot of terminal logs
On the client side I use y-websocket and Y.js and the server side uses uWebsocket. Every 30 seconds the client disconnects and reconnects immediately afterwards. No ...
2
votes
1
answer
584
views
uWebSockets.js opens with one ID but closes with other ID
I'm using Bun + Elysia and they are using uWebSockets.js. I use Postman to test, when i make connection it opens with one id number but when i close it closes with other ID number.
Should the ID's be ...
0
votes
0
answers
639
views
Issue building C++ example provided by uWebsockets using CMake
I have the following directory structure for my project that utilizes uWebsockets and I am trying to run the example provided by in uWebsockets examples folder. Interestingly, uWebsockets does not ...
4
votes
2
answers
3k
views
Integrating uWebSockets into a CMake project
I want to use uWebSockets for my own project which uses CMake.
There are two issues for me:
uWebSocket uses Make as well as I think its own build system/file build.c?
It depends itself on other ...
5
votes
0
answers
649
views
How to connect to laravel soketi from other client except laravel-echo?
I am using laravel soketi package. And I dont want to use laravel-echo for client connection. So, I am testing with firecamp. But not able to connect.
Soketi is up and running with
🎉 Server is up ...
0
votes
2
answers
2k
views
How to get Body from API using uWebSocket.js?
I'm using uWebSocket.js and tried to get the payload from an API. I have checked its official GitHub site related to routes.
I checked and implemented all the way explained in that and it works fine. ...
0
votes
1
answer
100
views
How can I modify(add/delete resource paths) a running uWebSockets server?
I have implemented a simple uWebsockets server that is listening on a certain port. Lets say I have added some resource paths to the Webserver(ex: /test1, /test2) so the server is listening and a ...
2
votes
1
answer
3k
views
Is it possible to use Socket.io client with uWebsockets.js server?
The same as in question I wonder if it is possible to use:
socket-io-client:
https://www.npmjs.com/package/socket.io-client
with uWebsockets.js server:
https://github.com/uNetworking/uWebSockets
...
3
votes
0
answers
2k
views
Building & using uWebSockets
Recently, I've been trying to get uWebSockets working, but I have absolutely no idea how to compile it in order to add it to my project in the include directory. The furthest I've been able to get was ...
0
votes
2
answers
2k
views
Serving static files in uWebSockets HTTP server (C++)
I am setting up an HTTP server in C++ using the uWebSockets library and I would like to add a middleware to serve static files, similar to what app.use(express.static(path.join(__dirname, 'public'))); ...
3
votes
1
answer
8k
views
Correct way to install and run uWebSockets in C++
What is the recommended way to install the library uWebSockets (https://github.com/uNetworking/uWebSockets) and be able to compile the accompanying examples ?
I have tried the solution provided here: ...
3
votes
0
answers
1k
views
uWebSockets static library installed via vcpkg but dll are still needed for executable on Windows
I have a Visual Studio C++ project that is making use of uWebSockets. The Visual Studio project file is configured to output a .dll that is used during runtime of a host executable. I need some of ...
0
votes
0
answers
29
views
How do you set up a simple HTTP server in C++? [duplicate]
I have been having a lot of difficulty trying to get a simple HTTP server built in to my application. It will be communicating only with other servers on the same local network, so SSL/TLS is not ...
1
vote
1
answer
529
views
Use uWebSockets with my own httpServer implementation
I have a NodeJs application and I want to use uWebSockets.
The problem is that I have a predefined custom HTTP server that I must use.
I wanted to know if its possible to inject our custom HTTP server ...
1
vote
0
answers
529
views
Why is my array buffer suddenly detaching?
I have the following uWebsockets application:
const app = uWS.App({}).ws("/*", {
message: (ws, bytes, isBinary) => {
invariant(isBinary, "Websocket messages must be binary"...
1
vote
1
answer
1k
views
Using Redis with uWebSockets C++ server
I currently have a C++ web sockets server using uWebSockets. I want to scale it horizontally using Redis. It means that I'll use this Redis client.
However, I'm facing a problem with the ...
0
votes
0
answers
2k
views
How to I install libuv and subsequently uWebSockets library on Windows 10?
I am trying to install few libraries that are required for cmake to build a project.
For successful build, cmake requires libuv and uWebSockets libraries to be installed:
https://github.com/...
0
votes
1
answer
442
views
Heroku Node.js and uWebsockets.js R10 Error, failed to bind port
I have created a minimal app for testing deploying a node.js uWebsockets.js server on heroku with a dockerfile.
Heroku logs shows that it fails with R10 (boot timeout) error, failed to bind to $PORT, ...
0
votes
0
answers
479
views
How can I setup uWebSockets.js into existing KOA server?
I have an existing KOA server, and would like to use uWebSockets.js for a part of it (like chat functionality and other kind of direct notifications)
I see that uWebSockets.js can run as a standalone ...
4
votes
0
answers
491
views
In uWebSockets, what are the pros and cons of using a Shared compressor, Dedicated compressor, or no compression?
Hello friends of Stackoverflow,
I am using the uWebsockets.js library for a realtime app. This library, a performance-based replacement for the original Websockets library, provides a users a few ...
0
votes
1
answer
601
views
Websockets severe delay/latency
We're using websockets (specifically uws.js on Node.js) to run a multiplayer quiz. The server's running on an AWS t2.micro in the eu-west-2a region, but recently, we've been seeing some incredibly ...
1
vote
1
answer
913
views
How to access IP address of HTTP requests using uWS?
I am using uWebSockets to do a project. What I need to do is get the sender IP address out of incoming HTTP Requests. In the documentation I can see IP address can be taken out from the WebSockets. Do ...
0
votes
1
answer
2k
views
uWebsocket sending messages via WebSocket outside of the .message Behavior context
I have to open with the obligatory, I'm pretty trash at c++, fresh out of college.
I setup uWebsocket as a server, it's currently just echoing responses back to the client.
I am trying to setup a ...
0
votes
0
answers
66
views
Different qtcreator behavior in compiling code
I'm trying to compile this code using Qtcreator:
uWS::App().ws<PerSocketData>("/*", {
/* Settings */
.compression = uWS::DEDICATED_COMPRESSOR_3KB,
....
7
votes
0
answers
3k
views
Client for uWebSockets
I'm using primarily C++ and want to implement server-client communication for a project. While not well-versed in distributed computing, I've tried various tool combinations like SocketIO server (in ...
0
votes
1
answer
643
views
error: no matching function for call to 'uWS::TemplatedApp<false>::ws<main()::UserData>(const char [3], <brace-enclosed initializer list>)'
I'm ussing uwebsockets to create ws server.
main.cpp:
int main()
{
struct UserData {
};
uWS::App().ws<UserData>("/*", {
/* Just a few of the available handlers */
....
0
votes
1
answer
569
views
uwebsockets failed to start: libuv.c:-1: error: undefined reference to `uv_is_closing'
My project has linked uwebsockets.
linked libs:
C:/Users/Sunway/.conan/data/zlib/1.2.11/_/_/package/a955db98e980a5ab86ae50d6df8bfee361185c27/lib/libzlib.a;
C:/Users/Sunway/.conan/data/libuv/1.41.0/_/_/...
1
vote
1
answer
2k
views
How to get the socket path in uWebSockets.js?
On my server based on uWebSocket.js, I'm using a parameterized path like /socket/:name.
How do I capture the actual path used?
For instance, if the socket was connected to /socket/one, I'd like to be ...
1
vote
1
answer
4k
views
How to call uWebSockets http routes from front-end with axios?
I'm using uWebSockets on my nodejs app and I'm trying to send some http requests to the wss server.
I can see the output of the GET routes on the wss server by accessing them from browser url bar, but ...
3
votes
1
answer
323
views
Private npm package fails to install with `npm ci` , but works with `npm i` why?
I have this package in my package.json: "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.9.0",
when trying to install this package within docker with npm i -> works
...
0
votes
1
answer
614
views
confusing websocket tls functionality
ive tried out a websocket library today called uwebsockets.
my code is just the one of the provided examples on their github.
int main() {
struct PerSocketData {
};
std::vector<std::thread*> ...
1
vote
0
answers
483
views
uwebsockets compile error Visual Studio 2019
I currently trying to setup the development environment in Visual studio for an extended kalman filter. I have installed all the required header files and libraries through vcpkg and also linked them ...
0
votes
1
answer
316
views
Getting uWebSockets for Visual 2017 via Conan
I'm trying to add uWebSockets as a dependency in my conan.txt
conan install .. returns the following error:
ERROR: uwebsockets/18.3.0: Invalid configuration: uwebsockets requires a compiler that ...
0
votes
1
answer
768
views
uWebSockets http serves too slow
I've cloned uWebSockets, wrote the following file.
#include <App.h>
#include <iostream>
int main() {
uWS::App()
.get("/*", [](auto *res, auto *req) {
...
4
votes
3
answers
2k
views
Reading multipartform-data stream correctly (NodeJS)
I'm trying to receive a multipartform-data stream which might include various files and fields and to write the files to a directory (uWebsockets.js server).
I have this code:
let boundary = null;
...
3
votes
0
answers
423
views
uWebSockets returning a binary buffer
I'm using uWebSockets C++ trying to return a binary buffe. When I do res->end(...) it sends and empty response, here's my code:
.get("/binaryfile", [](auto *res, auto *req) { ...
1
vote
1
answer
1k
views
uWebSockets concurrent sessions
for the sake of simplicity, let's assume I have only one uWebSockets instance running on my server:
struct UserData
{
uWS::WebSocket<true, uWS::SERVER> *ws;
bool logged_in = false;
ID ...
2
votes
1
answer
2k
views
uWebSockets undefined references in eclipse cpp ide
I'm new to c++ and i miss many knowledge about it. Mostly i get the work done by try and error.
But now i stuck on setting up a test project for a websocket server using uWebSockets.
Badly there is ...
3
votes
2
answers
6k
views
How to use uWebsockets from Visual Studio C++?
uWebSockets https://github.com/uNetworking/uWebSockets
How to use this from Visual Studio C++ ? I wish to implement a simple websocket server. I don't want to use Makefile, wish to use normal visual ...
0
votes
3
answers
3k
views
"Broadcast" or "Room" based Websocket Strategy
What are the techniques or strategies behind the "room" based WebSocket connection or "broadcast" option in WebSocket?
Do we store "user's WebSocket connection ID" in a specific list for a room-based ...
1
vote
1
answer
4k
views
Build uWebSockets on Windows 10 with CMake
I want to use uWebSockets(UWS) in my C++ project to transfer images over the network. The setup will be running on multiple operating systems, so the best way of creating the build files seemed like ...