TunConfig.fromJson constructor

TunConfig.fromJson(
  1. Object? json
)

Implementation

factory TunConfig.fromJson(Object? json) {
  final map = asJsonMap(json, 'tun inbound');
  return TunConfig(
    name: map['name'] as String?,
    mtu: map['mtu'] as int?,
    gateway: (map['gateway'] as List?)?.cast<String>(),
    dns: (map['dns'] as List?)?.cast<String>(),
    userLevel: map['userLevel'] as int?,
    autoSystemRoutingTable: (map['autoSystemRoutingTable'] as List?)
        ?.cast<String>(),
    autoOutboundsInterface: map['autoOutboundsInterface'] as String?,
  );
}