Skip to content

Commit eb028b6

Browse files
committed
chore: better reflect using in vision
1 parent 48c1b1c commit eb028b6

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/metacubex/sing-shadowsocks2 v0.2.6
3232
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2
3333
github.com/metacubex/sing-tun v0.4.7
34-
github.com/metacubex/sing-vmess v0.2.4-0.20250731011226-ea28d589924d
34+
github.com/metacubex/sing-vmess v0.2.4-0.20250817075824-5e05f123ccdd
3535
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f
3636
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee
3737
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 h1:gXU+MY
131131
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2/go.mod h1:mbfboaXauKJNIHJYxQRa+NJs4JU9NZfkA+I33dS2+9E=
132132
github.com/metacubex/sing-tun v0.4.7 h1:ZDY/W+1c7PeWWKeKRyUo18fySF/TWjB0i5ui81Ar778=
133133
github.com/metacubex/sing-tun v0.4.7/go.mod h1:xHecZRwBnKWe6zG9amAK9cXf91lF6blgjBqm+VvOrmU=
134-
github.com/metacubex/sing-vmess v0.2.4-0.20250731011226-ea28d589924d h1:koSVAQiYqU/qtJ527e+wbsEPvTaM39HW75LSvh04IT0=
135-
github.com/metacubex/sing-vmess v0.2.4-0.20250731011226-ea28d589924d/go.mod h1:21R5R1u90uUvBQF0owoooEu96/SAYYD56nDrwm6nFaM=
134+
github.com/metacubex/sing-vmess v0.2.4-0.20250817075824-5e05f123ccdd h1:VfD6UxKPAg7u9rPyxl18lQkpE9s8dZq0u2cPAgQShWs=
135+
github.com/metacubex/sing-vmess v0.2.4-0.20250817075824-5e05f123ccdd/go.mod h1:21R5R1u90uUvBQF0owoooEu96/SAYYD56nDrwm6nFaM=
136136
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f h1:Sr/DYKYofKHKc4GF3qkRGNuj6XA6c0eqPgEDN+VAsYU=
137137
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f/go.mod h1:jpAkVLPnCpGSfNyVmj6Cq4YbuZsFepm/Dc+9BAOcR80=
138138
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee h1:lp6hJ+4wCLZu113awp7P6odM2okB5s60HUyF0FMqKmo=

transport/vless/vision/vision.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ func NewConn(conn connWithUpstream, userUUID *uuid.UUID) (*Conn, error) {
6161
default:
6262
return nil, fmt.Errorf(`failed to use vision, maybe "security" is not "tls" or "utls"`)
6363
}
64-
i, _ := t.FieldByName("input")
65-
r, _ := t.FieldByName("rawInput")
66-
c.input = (*bytes.Reader)(unsafe.Add(p, i.Offset))
67-
c.rawInput = (*bytes.Buffer)(unsafe.Add(p, r.Offset))
64+
if i, ok := t.FieldByName("input"); ok {
65+
c.input = (*bytes.Reader)(unsafe.Add(p, i.Offset))
66+
}
67+
if r, ok := t.FieldByName("rawInput"); ok {
68+
c.rawInput = (*bytes.Buffer)(unsafe.Add(p, r.Offset))
69+
}
6870
return c, nil
6971
}
7072

0 commit comments

Comments
 (0)