Theldus / wsServer

wsServer - a tiny WebSocket server library written in C
https://theldus.github.io/wsServer
GNU General Public License v3.0
427 stars 86 forks source link

Why would I want to use civetweb for WebSockets, if this exists? #83

Open mavavilj opened 11 months ago

mavavilj commented 11 months ago

I initially looked at using civetweb to run a WebSocket Server:

https://github.com/civetweb/civetweb

Then I found this library.

Now I am wondering, what point might civetweb have in comparison to this project. Civetweb seemed more popular, but this seems far simpler.

mavavilj commented 11 months ago

Oh, well at least the license is different (GPL vs MIT).

Theldus commented 11 months ago

Hi @mavavilj, I have never used civetweb, so my observations below are based on what I could understand from the project (and src), so take my words with a grain of salt.

Apparently, civetweb seems to be an all-in-one solution for the web: in addition to WebSockets, it provides a web server that supports CGI, Lua scripts, and SSL (also for WebSocket).

Focusing solely on WebSocket, it seems to support:

From an implementation perspective, it looks quite similar to wsServer, with a thread-based approach, use of events, and so on.

In general, wsServer strives to be compliant only with RFC6455, while civet seems to aim for more universality. Still, regarding this, I haven't seen compliance tests with the standard in civet (like Autobahn), so I can't say how compliant it is[^note]. For example, I noticed that the client's close is not 'clean' if the client do not send any message.

Which one should you use? It depends on your requirements. If you:

use wsServer.

Oh, well at least the license is different (GPL vs MIT).

As you also pointed out, there's also the licensing issue... MIT is more permissive than GPLv3... I really wanted to change the license of wsServer, but I need acknowledgment from all the committers/contributors to the project, so I haven't done it yet.

[^note]: I've decided to give a try and test civetweb on the Autobahn, adapting the 'ws_server.c' example to echo messages and... as expected, I encountered some failures, which can be seen in the attached file (see reports/civet/index.html).

keifufu commented 11 months ago

Is there a chance we could see the license of wsServer change to MIT soon? I've been testing this library and love it due to its simplicity and would prefer it over all other libraries I've found so far, but I'm hesitant to license my own libraries/projects under GPLv3.

Theldus commented 11 months ago

Hi @keifufu, The best I can do at the moment is to ask all existing contributors for their permission under the license change, which I did in issue #84.

However, it is highly likely that I will not receive an ack from everyone in a timely manner (or any ack at all...), so the best we can do now is wait =).

keifufu commented 11 months ago

I appreciate it. I will happily wait and see where this gets us!