create static method
Creates a SOCKS5 socket to the specified proxyHost
and proxyPort
.
This method is a factory constructor that returns a Future that resolves to a SOCKSSocket instance.
Parameters:
proxyHost
: The host of the SOCKS5 proxy server.proxyPort
: The port of the SOCKS5 proxy server.
Returns: A Future that resolves to a SOCKSSocket instance.
Implementation
static Future<SOCKSSocket> create(
{required String proxyHost,
required int proxyPort,
bool sslEnabled = false}) async {
// Create a SOCKS socket instance.
var instance = SOCKSSocket._(proxyHost, proxyPort, sslEnabled);
// Initialize the SOCKS socket.
await instance._init();
// Return the SOCKS socket instance.
return instance;
}