From 157e65b34d32363528088c592d4e415d84f01a63 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+RPRX@users.noreply.github.com> Date: Sat, 21 Mar 2026 13:19:32 +0000 Subject: [PATCH] REALITY config: Print Warning when user is choosing apple/icloud as the target or listening on non-443 ports https://t.me/projectXtls/1754 https://github.com/XTLS/BBS/issues/21#issuecomment-4103308607 --- infra/conf/transport_internet.go | 6 ++++++ infra/conf/xray.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index c65c175c..7a302aec 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -909,6 +909,12 @@ func (c *REALITYConfig) Build() (proto.Message, error) { } } + for _, sn := range config.ServerNames { + if strings.Contains(sn, "apple") || strings.Contains(sn, "icloud") { + errors.LogWarning(context.Background(), `REALITY: Choosing apple, icloud, etc. as the target may get your IP blocked by the GFW`) + } + } + config.LimitFallbackUpload = new(reality.LimitFallback) config.LimitFallbackUpload.AfterBytes = c.LimitFallbackUpload.AfterBytes config.LimitFallbackUpload.BytesPerSec = c.LimitFallbackUpload.BytesPerSec diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 15e4a191..a2410244 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -174,6 +174,10 @@ func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error) { return nil, err } receiverSettings.StreamSettings = ss + if strings.Contains(ss.SecurityType, "reality") && (receiverSettings.PortList == nil || + len(receiverSettings.PortList.Ports()) != 1 || receiverSettings.PortList.Ports()[0] != 443) { + errors.LogWarning(context.Background(), `REALITY: Listening on non-443 ports may get your IP blocked by the GFW`) + } } if c.SniffingConfig != nil { s, err := c.SniffingConfig.Build()