[Libwebsockets] Your thoughts on how to implement the following please.

Mooki Moo mookimoo73 at gmail.com
Fri Apr 13 10:27:38 CEST 2018


Hello List,

I hope this isn't cheeky for my first post but I was wondering if the
list readers might be able to help me here and point me in the right
direction for my development. I am writing a WSS (only) Server using
this library and I confess to not knowing very much about it, as this
is the first time I have used it, but what I want to do is the
following:

When a user connects (via Web Browser) I need to provide them with
their own database class, this class supports the usual CRUD
operations for the user but it also has in it an async notification
listener that listens on a user specific channel, with the channel
determined at login.

When data arrives on this channel I want to pass it to the WSS Client
(User) it is intended for with minimal overhead. Some of the users
will have limited traffic while others maybe getting notifications <1s
so I don’t want to choke the system.

Although I don’t really know how to do it I can’t help but think that
the best way to achieve this is to give each connected client their
own protocol handler (or is that a vhost?) but is this possible? If it
is are there any examples available on how I can implement this.

FWIW the number of concurrent users will be under 50.

I’m building and running on Linux (4.15.15.-1 ARCH) using
libwebsockets v2.4.2 with no libuv support (but I can change this)
g++ 7.3.1

--
Bill


More information about the Libwebsockets mailing list