create static method
SshClient
create({
- required SshClientConfig config,
- required List<
SshAuthMethod> authMethods, - SshSecureSocketTransport? transport,
- SshUserAuthProtocolAuthenticator authenticator = const SshUserAuthProtocolAuthenticator(),
- int sftpProtocolVersion = 3,
Implementation
static SshClient create({
required SshClientConfig config,
required List<SshAuthMethod> authMethods,
SshSecureSocketTransport? transport,
SshUserAuthProtocolAuthenticator authenticator =
const SshUserAuthProtocolAuthenticator(),
int sftpProtocolVersion = 3,
}) {
final SshSecureSocketTransport resolvedTransport =
transport ?? SshSecureSocketTransport();
final SshPacketChannelFactory channelFactory = SshPacketChannelFactory(
transport: resolvedTransport,
);
return SshClient(
config: config,
authMethods: authMethods,
transport: resolvedTransport,
authenticator: authenticator,
channelFactory: channelFactory,
sessionManager: SshProtocolSessionManager(channelFactory: channelFactory),
execService: SshProtocolExecService(channelFactory: channelFactory),
sftpSubsystem: SshProtocolSftpSubsystem(
channelFactory: channelFactory,
protocolVersion: sftpProtocolVersion,
),
portForwardingService: SshIoPortForwardingService(
transport: resolvedTransport,
channelFactory: channelFactory,
),
);
}