Chore: unified naming "skip-cert-verify"
This commit is contained in:
@ -28,18 +28,18 @@ func (ss *Socks5Adapter) Conn() net.Conn {
|
||||
}
|
||||
|
||||
type Socks5 struct {
|
||||
addr string
|
||||
name string
|
||||
tls bool
|
||||
sni bool
|
||||
addr string
|
||||
name string
|
||||
tls bool
|
||||
skipCertVerify bool
|
||||
}
|
||||
|
||||
type Socks5Option struct {
|
||||
Name string `proxy:"name"`
|
||||
Server string `proxy:"server"`
|
||||
Port int `proxy:"port"`
|
||||
TLS bool `proxy:"tls"`
|
||||
SNI bool `proxy:"sni"`
|
||||
Name string `proxy:"name"`
|
||||
Server string `proxy:"server"`
|
||||
Port int `proxy:"port"`
|
||||
TLS bool `proxy:"tls,omitempty"`
|
||||
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
|
||||
}
|
||||
|
||||
func (ss *Socks5) Name() string {
|
||||
@ -55,7 +55,7 @@ func (ss *Socks5) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err e
|
||||
|
||||
if err == nil && ss.tls {
|
||||
tlsConfig := tls.Config{
|
||||
InsecureSkipVerify: ss.sni,
|
||||
InsecureSkipVerify: ss.skipCertVerify,
|
||||
MaxVersion: tls.VersionTLS12,
|
||||
}
|
||||
c = tls.Client(c, &tlsConfig)
|
||||
@ -104,9 +104,9 @@ func (ss *Socks5) shakeHand(metadata *C.Metadata, rw io.ReadWriter) error {
|
||||
|
||||
func NewSocks5(option Socks5Option) *Socks5 {
|
||||
return &Socks5{
|
||||
addr: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
name: option.Name,
|
||||
tls: option.TLS,
|
||||
sni: option.SNI,
|
||||
addr: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
name: option.Name,
|
||||
tls: option.TLS,
|
||||
skipCertVerify: option.SkipCertVerify,
|
||||
}
|
||||
}
|
||||
|
@ -31,15 +31,16 @@ type Vmess struct {
|
||||
}
|
||||
|
||||
type VmessOption struct {
|
||||
Name string `proxy:"name"`
|
||||
Server string `proxy:"server"`
|
||||
Port int `proxy:"port"`
|
||||
UUID string `proxy:"uuid"`
|
||||
AlterID int `proxy:"alterId"`
|
||||
Cipher string `proxy:"cipher"`
|
||||
TLS bool `proxy:"tls,omitempty"`
|
||||
Network string `proxy:"network,omitempty"`
|
||||
WSPath string `proxy:"ws-path,omitempty"`
|
||||
Name string `proxy:"name"`
|
||||
Server string `proxy:"server"`
|
||||
Port int `proxy:"port"`
|
||||
UUID string `proxy:"uuid"`
|
||||
AlterID int `proxy:"alterId"`
|
||||
Cipher string `proxy:"cipher"`
|
||||
TLS bool `proxy:"tls,omitempty"`
|
||||
Network string `proxy:"network,omitempty"`
|
||||
WSPath string `proxy:"ws-path,omitempty"`
|
||||
SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"`
|
||||
}
|
||||
|
||||
func (ss *Vmess) Name() string {
|
||||
@ -63,13 +64,14 @@ func (ss *Vmess) Generator(metadata *C.Metadata) (adapter C.ProxyAdapter, err er
|
||||
func NewVmess(option VmessOption) (*Vmess, error) {
|
||||
security := strings.ToLower(option.Cipher)
|
||||
client, err := vmess.NewClient(vmess.Config{
|
||||
UUID: option.UUID,
|
||||
AlterID: uint16(option.AlterID),
|
||||
Security: security,
|
||||
TLS: option.TLS,
|
||||
Host: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
NetWork: option.Network,
|
||||
WebSocketPath: option.WSPath,
|
||||
UUID: option.UUID,
|
||||
AlterID: uint16(option.AlterID),
|
||||
Security: security,
|
||||
TLS: option.TLS,
|
||||
Host: fmt.Sprintf("%s:%d", option.Server, option.Port),
|
||||
NetWork: option.Network,
|
||||
WebSocketPath: option.WSPath,
|
||||
SkipCertVerify: option.SkipCertVerify,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user