mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-26 02:21:27 +00:00
XUDP Global ID should be empty if "cone" is disabled (client side)
This commit is contained in:
parent
24a2be43ef
commit
01b7e5e9be
|
@ -47,6 +47,9 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetGlobalID(ctx context.Context) (globalID [8]byte) {
|
func GetGlobalID(ctx context.Context) (globalID [8]byte) {
|
||||||
|
if cone := ctx.Value("cone"); cone == nil || !cone.(bool) { // cone is nil only in some unit tests
|
||||||
|
return
|
||||||
|
}
|
||||||
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.Network == net.Network_UDP &&
|
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.Network == net.Network_UDP &&
|
||||||
(inbound.Name == "dokodemo-door" || inbound.Name == "socks" || inbound.Name == "shadowsocks") {
|
(inbound.Name == "dokodemo-door" || inbound.Name == "socks" || inbound.Name == "shadowsocks") {
|
||||||
h := blake3.New(8, BaseKey)
|
h := blake3.New(8, BaseKey)
|
||||||
|
|
Loading…
Reference in a new issue