bind static method
Future<MultiProtocolHttpServer>
bind(
- Object? address,
- int port,
- SecurityContext context, {
- ServerSettings? settings,
Binds a new SecureServerSocket with a security context
at port
and
address
(see SecureServerSocket.bind for a description of supported
types for address
).
Optionally settings
can be supplied which will be used for HTTP/2
clients.
See also startServing.
Implementation
static Future<MultiProtocolHttpServer> bind(
Object? address, int port, SecurityContext context,
{http2.ServerSettings? settings}) async {
context.setAlpnProtocols(['h2', 'h2-14', 'http/1.1'], true);
var secureServer = await SecureServerSocket.bind(address, port, context);
return MultiProtocolHttpServer._(secureServer, settings);
}