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:
Follow the instructions at the lsquic GitHub for installing and building both
boringsslandlsquic(Note: I used commit8927cb8f814ad3cb7cde08f02e826f1eed02bfb0instead of their example commit for the checkout onboringsslas that is the version linked to the version ofuSocketslinked to the latest version ofuWebSockets)git clone https://github.com/uNetworking/uSockets.gitandcd uSockets- Here, I also tried doing
git reset --hard 3cd87094c6dc2e158221a3e25dcefde0b8093ca7in a separate attempt (the version linked in the latest version ofuWebSockets) in theuSocketsdirectory, but it didn't affect anything to my knowledge.
- Here, I also tried doing
Move the entirety of both
boringsslandlsquic's contents touSockets/boringsslanduSockets/lsquicrespectively, and delete the original directories.cd uSocketsandWITH_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.
--recurse-submodulesor callinggit submodule update --init --recursiveafter a git clone of uWebsockets? I just tried that and a singlemake -j8built everything for me afterwards.EchoServerexample and use PostMan to connect to it, it simply gives me aECONNREFUSEDerror - 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 touWS::App()and still nothing worked)HelloWorldexample does work, so I have no idea what is going wrong with this specific example (and I need WebSockets, not HTTP).