diff --git a/adapter/outbound/vmess.go b/adapter/outbound/vmess.go index f7de4e8e..0ea8d859 100644 --- a/adapter/outbound/vmess.go +++ b/adapter/outbound/vmess.go @@ -459,6 +459,11 @@ func NewVmess(option VmessOption) (*Vmess, error) { option: &option, } + v.realityConfig, err = v.option.RealityOpts.Parse() + if err != nil { + return nil, err + } + switch option.Network { case "h2": if len(option.HTTP2Opts.Host) == 0 { @@ -507,11 +512,6 @@ func NewVmess(option VmessOption) (*Vmess, error) { v.transport = gun.NewHTTP2Client(dialFn, tlsConfig, v.option.ClientFingerprint, v.realityConfig) } - v.realityConfig, err = v.option.RealityOpts.Parse() - if err != nil { - return nil, err - } - return v, nil }