dart-lang / http2

A HTTP/2 implementation for dart.

Home Page:https://pub.dev/packages/http2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to check if ALPN contains h2?

opened this issue · comments

like this

// getAlpnProtocols as List<String>
if (context.getAlpnProtocols.contains('h2')) {
  final server = await MultiProtocolHttpServer.bind(address, port ?? 443, context);
  // code ...
} else {
  final server = await HttpServer.bindSecure(address, port ?? 443, context);
  // code ...
}```

This would be on SecurityContext, which is part of dart:io.