SocksServerConfig.fromJson constructor

SocksServerConfig.fromJson(
  1. Object? json
)

Implementation

factory SocksServerConfig.fromJson(Object? json) {
  final map = asJsonMap(json, 'socks inbound');
  return SocksServerConfig(
    authMethod: map['auth'] == null
        ? null
        : SocksAuthMethod.fromJson(map['auth']),
    accounts: map['accounts'] == null
        ? null
        : asJsonList(map['accounts'], SocksAccount.fromJson),
    udp: map['udp'] as bool?,
    host: map['ip'] == null ? null : XrayAddress.fromJson(map['ip']),
    userLevel: map['userLevel'] as int?,
  );
}