Skip to content

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

Open

Description

@mavavilj

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.

Activity

  1. mavavilj commented on Dec 2, 2023

    @mavavilj
    Author

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

  2. Theldus commented on Dec 3, 2023

    @Theldus
    Owner

    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

    1. 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). ↩

  3. keifufu commented on Dec 3, 2023

    @keifufu

    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.

  4. Theldus commented on Dec 3, 2023

    @Theldus
    Owner

    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 =).

  5. keifufu commented on Dec 3, 2023

    @keifufu

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions