Building & using uWebSockets

1k Views Asked by At

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 through this:

  1. Follow the instructions at the lsquic GitHub for installing and building both boringssl and lsquic (Note: I used commit 8927cb8f814ad3cb7cde08f02e826f1eed02bfb0 instead of their example commit for the checkout on boringssl as that is the version linked to the version of uSockets linked to the latest version of uWebSockets)

  2. git clone https://github.com/uNetworking/uSockets.git and cd uSockets

    • Here, I also tried doing git reset --hard 3cd87094c6dc2e158221a3e25dcefde0b8093ca7 in a separate attempt (the version linked in the latest version of uWebSockets) in the uSockets directory, but it didn't affect anything to my knowledge.
  3. Move the entirety of both boringssl and lsquic's contents to uSockets/boringssl and uSockets/lsquic respectively, and delete the original directories.

  4. cd uSockets and WITH_QUIC=1 make examples

At this point, the make fails, with errors such as these:

examples/http3_client.c: In function ‘on_stream_headers’:
examples/http3_client.c:87:5: error: too few arguments to function ‘us_quic_socket_create_stream’
   87 |     us_quic_socket_create_stream(us_quic_stream_socket(s));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from examples/http3_client.c:11:
src/quic.h:47:6: note: declared here
   47 | void us_quic_socket_create_stream(us_quic_socket_t *s, int ext_size);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are a few more errors, all about functions that have the wrong amount of arguments passed into them.

What am I doing wrong here? Why is this such a big headache, and why is there literally no documentation from uWebSockets or uSockets on how to actually build their code?

Note: Please add a comment if you would like to see the full logs, I can redo the process and add it to a pastebin.

0

There are 0 best solutions below