3

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.

3
  • I don't understand why you are taking all these steps. I notice that uWebSockets refers to uSockets via a git submodule. Have you tried cloning with --recurse-submodules or calling git submodule update --init --recursive after a git clone of uWebsockets? I just tried that and a single make -j8 built everything for me afterwards. Commented Nov 3, 2022 at 8:49
  • @Botje I've compiled with that, but now when I try to run the EchoServer example and use PostMan to connect to it, it simply gives me a ECONNREFUSED error - and on Chrome, it says "This page isn't working - localhost didn't send any data". Any tips? (I also removed the SSL configuration by changing it to uWS::App() and still nothing worked) Commented Nov 3, 2022 at 16:16
  • However, the HelloWorld example does work, so I have no idea what is going wrong with this specific example (and I need WebSockets, not HTTP). Commented Nov 3, 2022 at 16:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.