You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Why would I want to use civetweb for WebSockets, if this exists? #83
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:
Native SSL support (wsServer requires a proxy for this)
Deflate support (compression)
WebSocket extensions
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 is1. 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:
Only need WebSocket
Don't need SSL or plan to use a proxy (like nginx, Stunnel...)
Want small and hackable code (2k LOC vs 20k LOC)
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.
Footnotes
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). ↩
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.
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 =).
Activity
mavavilj commentedon Dec 2, 2023
Oh, well at least the license is different (GPL vs MIT).
Theldus commentedon Dec 3, 2023
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 is1. 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.
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.
Footnotes
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 commentedon Dec 3, 2023
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 commentedon Dec 3, 2023
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 commentedon Dec 3, 2023
I appreciate it. I will happily wait and see where this gets us!