secureSocketLookUps function

AtLookUpFactory secureSocketLookUps({
  1. SecureSocketConfig? config,
  2. Future<void> onConnect(
    1. AtCommandExecutor connection
    )?,
})

The default AtLookUpFactory: every connection over TLS on TCP, under config (the TLS defaults with none), through AtLookUp.withSecureSocket.

onConnect runs on each connection once it is up and before anything else is sent on it, which is how a deployment behind a proxy sends the from: the proxy needs first.

Implementation

AtLookUpFactory secureSocketLookUps({
  SecureSocketConfig? config,
  Future<void> Function(AtCommandExecutor connection)? onConnect,
}) {
  final transport = secureSocketTransport(config ?? SecureSocketConfig());
  return ({
    required String atSign,
    required AtRootDomain rootDomain,
    required AtAuthenticator? authenticator,
    SecondaryAddressFinder? secondaryAddressFinder,
  }) =>
      AtLookUp.withSecureSocket(
        atSign: atSign,
        rootDomain: rootDomain,
        authenticator: authenticator,
        transport: transport,
        secondaryAddressFinder: secondaryAddressFinder ??
            CacheableSecondaryAddressFinder(
                rootDomain.rootDomain, rootDomain.rootPort),
        onConnect: onConnect,
      );
}