toPacString method

String toPacString()

Implementation

String toPacString() {
  String type = 'DIRECT';
  switch (this.type) {
    case SentryProxyType.direct:
      return 'DIRECT';
    case SentryProxyType.http:
      type = 'PROXY';
      break;
    case SentryProxyType.socks:
      type = 'SOCKS';
      break;
  }
  if (host != null && port != null) {
    return '$type $host:$port';
  } else if (host != null) {
    return '$type $host';
  } else {
    return 'DIRECT';
  }
}