Feature: support vmess tls mode

This commit is contained in:
Dreamacro
2018-09-08 19:53:24 +08:00
parent 834baa9e27
commit fcb46e7706
4 changed files with 33 additions and 2 deletions

View File

@ -48,16 +48,18 @@ func (ss *Vmess) Generator(addr *C.Addr) (adapter C.ProxyAdapter, err error) {
return &VmessAdapter{conn: c}, err
}
func NewVmess(name string, server string, uuid string, alterID uint16, security string) (*Vmess, error) {
func NewVmess(name string, server string, uuid string, alterID uint16, security string, option map[string]string) (*Vmess, error) {
security = strings.ToLower(security)
client, err := vmess.NewClient(vmess.Config{
UUID: uuid,
AlterID: alterID,
Security: security,
TLS: option["tls"] == "true",
})
if err != nil {
return nil, err
}
return &Vmess{
name: name,
server: server,