You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like I said elsewhere, I have this server app that I've enabled ALPN in that I want to support HTTP/2 in. I want to use the nghttp2 C++ API directly instead of dropping it in as a reverse proxy. Could you point me to a good example that shows how to do this? And where and what functions should I call from the nghttp2 library to do this?
I have this code in main:
tcp::acceptor acceptor{ ioc, { address, port } };
std::cout << "Starting server at " << address << ':' << port << "...\n";
for (;;)
{
// This will receive the new connection
tcp::socket socket{ ioc };
// Block until we get a connection
acceptor.accept(socket);
// Launch the session, transferring ownership of the socketstd::thread([=, socket = std::move(socket), &ctx]() mutable {
do_session(socket, ctx, doc_root, googlekey, currencykey);
}).detach();
}
This is how I'm running the server. And I also have this code in do_session:
// Construct the stream around the socket
ssl::stream<tcp::socket&> stream{ socket, ctx };
// call client hello processing function and pass in callbackauto ssl_ctx{ ctx.native_handle() };
SSL* ssl{ SSL_new(ssl_ctx) };
int alert_val{ 1 };
int* alert{ &alert_val };
void* arg{};
SSL_CTX_set_client_hello_cb(ssl_ctx, set_client_hello_cb(ssl, alert, arg), nullptr);
// Perform the SSL handshake
stream.handshake(ssl::stream_base::server, ec);
if (ec)
{
std::cerr << "Lines 692 and 693:\n";
fail(ec, "handshake");
}
And these are the callbacks passed to the SSL_CTX_set_client_hello_cb and SSL_CTX_set_alpn_select_cb functions, respectively:
I don't understand what problem you are facing. Have you tried the examples here? I will copy those examples to this repo.
If you are asking if nghttp2 understands HTTP 1.1, this may be relevant to you. nghttp2/nghttp2#585
The maintainers of nghttp2/nghttp2 don't have the resources to maintain this library. So it has been moved here. It's upto the community to take it forward from here.
Like I said elsewhere, I have this server app that I've enabled ALPN in that I want to support HTTP/2 in. I want to use the nghttp2 C++ API directly instead of dropping it in as a reverse proxy. Could you point me to a good example that shows how to do this? And where and what functions should I call from the nghttp2 library to do this?
I have this code in
main
:This is how I'm running the server. And I also have this code in
do_session
:And these are the callbacks passed to the
SSL_CTX_set_client_hello_cb
andSSL_CTX_set_alpn_select_cb
functions, respectively:and
Did I do this right? And should I call the nghttp2 functions for HTTP/2 in
main
or indo_session
?And how come you're not maintaining
nghttp2-asio
? I mean, the last commit was just 10 days ago, wasn't it?The text was updated successfully, but these errors were encountered: