InboundDetourConfig.fromJson constructor

InboundDetourConfig.fromJson(
  1. Object? json
)

Implementation

factory InboundDetourConfig.fromJson(Object? json) {
  final map = asJsonMap(json, 'inbound');
  final protocol = map['protocol'] as String;
  final settingsJson = map['settings'];
  return InboundDetourConfig(
    protocol: protocol,
    port: map['port'] == null ? null : XrayPortList.fromJson(map['port']),
    listen: map['listen'] == null
        ? null
        : XrayAddress.fromJson(map['listen']),
    settings: settingsJson == null
        ? null
        : _parseInboundSettings(protocol, settingsJson),
    tag: map['tag'] as String?,
    streamSettings: map['streamSettings'] == null
        ? null
        : StreamConfig.fromJson(map['streamSettings']),
    sniffing: map['sniffing'] == null
        ? null
        : SniffingConfig.fromJson(map['sniffing']),
  );
}