StreamConfig.fromJson constructor

StreamConfig.fromJson(
  1. Object? json
)

Implementation

factory StreamConfig.fromJson(Object? json) {
  final map = asJsonMap(json, 'streamSettings');
  return StreamConfig(
    address: map['address'] == null
        ? null
        : XrayAddress.fromJson(map['address']),
    port: map['port'] as int?,
    network: map['network'] == null
        ? null
        : TransportProtocol.fromJson(map['network']),
    security: map['security'] == null
        ? null
        : SecurityProtocol.fromJson(map['security']),
    finalmask: map['finalmask'] == null
        ? null
        : FinalMask.fromJson(map['finalmask']),
    realitySettings: map['realitySettings'] == null
        ? null
        : REALITYConfig.fromJson(map['realitySettings']),
    tcpSettings: map['tcpSettings'] == null
        ? null
        : TCPConfig.fromJson(map['tcpSettings']),
    rawSettings: map['rawSettings'] == null
        ? null
        : TCPConfig.fromJson(map['rawSettings']),
    wsSettings: map['wsSettings'] == null
        ? null
        : WebSocketConfig.fromJson(map['wsSettings']),
    httpupgradeSettings: map['httpupgradeSettings'] == null
        ? null
        : HttpUpgradeConfig.fromJson(map['httpupgradeSettings']),
    splithttpSettings: map['splithttpSettings'] == null
        ? null
        : SplitHTTPConfig.fromJson(map['splithttpSettings']),
    xhttpSettings: map['xhttpSettings'] == null
        ? null
        : SplitHTTPConfig.fromJson(map['xhttpSettings']),
    grpcSettings: map['grpcSettings'] == null
        ? null
        : GRPCConfig.fromJson(map['grpcSettings']),
    kcpSettings: map['kcpSettings'] == null
        ? null
        : KCPConfig.fromJson(map['kcpSettings']),
    hysteriaSettings: map['hysteriaSettings'] == null
        ? null
        : HysteriaConfig.fromJson(map['hysteriaSettings']),
    tlsSettings: map['tlsSettings'] == null
        ? null
        : TLSConfig.fromJson(map['tlsSettings']),
    sockopt: map['sockopt'] == null
        ? null
        : SocketConfig.fromJson(map['sockopt']),
  );
}