bindSecure method

Future<void> bindSecure(
  1. InternetAddress address,
  2. int port,
  3. SecurityContext context, {
  4. int backlog = 0,
  5. bool v6Only = false,
  6. bool requestClientCertificate = false,
  7. bool requireClientCertificate = false,
  8. List<String>? supportedProtocols,
  9. bool shared = false,
})

Bind Socks secure server to given address and port.

See SecureServerSocket.bind for detailed information on named arguments.

Implementation

Future<void> bindSecure(InternetAddress address, int port, SecurityContext context, {
  int backlog = 0,
  bool v6Only = false,
  bool requestClientCertificate = false,
  bool requireClientCertificate = false,
  List<String>? supportedProtocols,
  bool shared = false,
}) async {
  if (_isPortInUse(port))
    throw const SocketException('Port is already bound to a proxy server.');
  return addSecureServerSocket(
    await SecureServerSocket.bind(address, port, context,
      backlog: backlog,
      v6Only: v6Only,
      requestClientCertificate: requestClientCertificate,
      requireClientCertificate: requireClientCertificate,
      supportedProtocols: supportedProtocols,
      shared: shared,
    ),
  );
}