Add some Http3 skeleton

This commit is contained in:
Alex Hultman
2022-05-02 23:32:55 +02:00
parent e4c6fbf8de
commit b46a456393
7 changed files with 88 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
/* Do not rely on this API, it will change */
#include "Http3App.h"
#include <iostream>
/* Tentative example of simple Http3 server */
int main() {
uWS::QuicApp({
.key_file_name = "../misc/key.pem",
.cert_file_name = "../misc/cert.pem",
.passphrase = "1234"
}).get("/*", [](auto *res, auto */*req*/) {
res->end("Hello quic!");
}).listen(3000, [](auto *listen_socket) {
if (listen_socket) {
std::cout << "Listening on port " << 3000 << std::endl;
}
}).run();
std::cout << "Failed to listen on port 3000" << std::endl;
}