github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/constant/proxy.go (about)

     1  package constant
     2  
     3  const (
     4  	TypeTun          = "tun"
     5  	TypeRedirect     = "redirect"
     6  	TypeTProxy       = "tproxy"
     7  	TypeDirect       = "direct"
     8  	TypeBlock        = "block"
     9  	TypeDNS          = "dns"
    10  	TypeSOCKS        = "socks"
    11  	TypeHTTP         = "http"
    12  	TypeMixed        = "mixed"
    13  	TypeShadowsocks  = "shadowsocks"
    14  	TypeVMess        = "vmess"
    15  	TypeTrojan       = "trojan"
    16  	TypeNaive        = "naive"
    17  	TypeWireGuard    = "wireguard"
    18  	TypeHysteria     = "hysteria"
    19  	TypeTor          = "tor"
    20  	TypeSSH          = "ssh"
    21  	TypeShadowTLS    = "shadowtls"
    22  	TypeShadowsocksR = "shadowsocksr"
    23  	TypeVLESS        = "vless"
    24  	TypeTUIC         = "tuic"
    25  	TypeHysteria2    = "hysteria2"
    26  )
    27  
    28  const (
    29  	TypeSelector = "selector"
    30  	TypeURLTest  = "urltest"
    31  )
    32  
    33  func ProxyDisplayName(proxyType string) string {
    34  	switch proxyType {
    35  	case TypeDirect:
    36  		return "Direct"
    37  	case TypeBlock:
    38  		return "Block"
    39  	case TypeDNS:
    40  		return "DNS"
    41  	case TypeSOCKS:
    42  		return "SOCKS"
    43  	case TypeHTTP:
    44  		return "HTTP"
    45  	case TypeShadowsocks:
    46  		return "Shadowsocks"
    47  	case TypeVMess:
    48  		return "VMess"
    49  	case TypeTrojan:
    50  		return "Trojan"
    51  	case TypeNaive:
    52  		return "Naive"
    53  	case TypeWireGuard:
    54  		return "WireGuard"
    55  	case TypeHysteria:
    56  		return "Hysteria"
    57  	case TypeTor:
    58  		return "Tor"
    59  	case TypeSSH:
    60  		return "SSH"
    61  	case TypeShadowTLS:
    62  		return "ShadowTLS"
    63  	case TypeShadowsocksR:
    64  		return "ShadowsocksR"
    65  	case TypeVLESS:
    66  		return "VLESS"
    67  	case TypeTUIC:
    68  		return "TUIC"
    69  	case TypeHysteria2:
    70  		return "Hysteria2"
    71  	case TypeSelector:
    72  		return "Selector"
    73  	case TypeURLTest:
    74  		return "URLTest"
    75  	default:
    76  		return "Unknown"
    77  	}
    78  }