setSocks5Proxy static method

Future<V2TXLiveCode> setSocks5Proxy(
  1. String host,
  2. int port,
  3. String username,
  4. String password,
  5. V2TXLiveSocks5ProxyConfig config,
)

Set up the SDK socks5 proxy configuration

Parameter:

host The address of the SOCKS5 proxy server

port The port of the SOCKS5 proxy server

username The username of the SOCKS5 proxy server

password The password of the SOCKS5 proxy server

config For details, please refer to V2TXLiveSocks5ProxyConfig

Implementation

static Future<V2TXLiveCode> setSocks5Proxy(
    String host, int port, String username, String password, V2TXLiveSocks5ProxyConfig config) async {
  var code = await V2TXLivePremier()._channel.invokeMethod("setSocks5Proxy", {
    "host": host,
    "port": port,
    "username": username,
    "password": password,
    "config": config.toJson()
  });
  if (code is V2TXLiveCode) {
    return code;
  } else {
    return V2TXLIVE_ERROR_FAILED;
  }
}