forked from lilendian0x00/xray-knife
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocols.go
105 lines (98 loc) · 3.88 KB
/
protocols.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package xray
import "github.com/xtls/xray-core/infra/conf"
type Protocol interface {
Parse(configLink string) error
BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
DetailsStr() string
ConvertToGeneralConfig() GeneralConfig
}
type GeneralConfig struct {
Protocol string
Address string
Security string
Aid string
Host string
ID string
Network string
Path string
Port string
Remark string
TLS string
SNI string
ALPN string
TlsFingerprint string
ServiceName string
Mode string
Type string
OrigLink string
}
type Vmess struct {
Version interface{} `json:"v"`
Address string `json:"add"`
Aid interface{} `json:"aid"` // AlterID
Port interface{} `json:"port"`
Security string `json:"scy"`
Host string `json:"host"`
ID string `json:"id"`
Network string `json:"net"`
Path string `json:"path"`
Remark string `json:"ps"` // Config's name
TLS string `json:"tls"`
AllowInsecure interface{} `json:"allowinsecure"`
SNI string `json:"sni"` // Server name indication
ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation
TlsFingerprint string `json:"fp"` // TLS fingerprint
Type string `json:"type"` // Used for HTTP Obfuscation
OrigLink string `json:"-"` // Original link
}
type Vless struct {
LinkVersion string `json:"-"`
ID string `json:"id"` // UUID
Address string `json:"add"` // HOST:PORT
Encryption string `json:"encryption"`
Flow string `json:"flow"`
Security string `json:"security"` // reality or tls
PublicKey string `json:"pbk"`
ShortIds string `json:"sid"` // Mandatory, the shortId list available to the client, which can be used to distinguish different clients
SpiderX string `json:"spx"` // Reality path
HeaderType string `json:"headerType"` // TCP HTTP Obfuscation
Host string `json:"host"` // HTTP, WS
Path string `json:"path"`
Port string `json:"port"`
SNI string `json:"sni"` // Server name indication
ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation
TlsFingerprint string `json:"fp"` // TLS fingerprint
Type string `json:"type"` // Network
Remark string `json:"ps"` // Config's name
ServiceName string `json:"serviceName"` // GRPC
Mode string `json:"mode"` // GRPC
OrigLink string `json:"-"` // Original link
}
type Shadowsocks struct {
Address string
Port string
Encryption string
Password string
Remark string
OrigLink string // Original link
}
type Trojan struct {
LinkVersion string `json:"-"`
Password string // Password
Address string `json:"add"` // HOST:PORT
Flow string `json:"flow"`
Security string `json:"security"` // tls
HeaderType string `json:"headerType"` // TCP HTTP Obfuscation
Host string `json:"host"` // HTTP, WS
Path string `json:"path"`
Port string `json:"port"`
SNI string `json:"sni"` // Server name indication
ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation
TlsFingerprint string `json:"fp"` // TLS fingerprint
AllowInsecure string `json:"allowInsecure"` // Insecure TLS
Type string `json:"type"` // Network
Remark string // Config's name
ServiceName string `json:"serviceName"` // GRPC
Mode string `json:"mode"` // GRPC
OrigLink string `json:"-"` // Original link
}