From 8816a22e97d848b75f982db596ee2afc4ecf83c4 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 16 Jun 2023 08:47:47 +0800 Subject: [PATCH] =?UTF-8?q?80/443=E7=AB=AF=E5=8F=A3=E7=9A=84=E6=BA=90?= =?UTF-8?q?=E7=AB=99=E8=87=AA=E5=8A=A8=E4=BF=AE=E6=AD=A3HTTP=E5=92=8CHTTPS?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=9C=89=E4=BA=9B?= =?UTF-8?q?=E5=B0=8F=E7=99=BD=E7=94=A8=E6=88=B7=E4=B8=8D=E7=9F=A5=E9=81=93?= =?UTF-8?q?HTTP=E5=92=8CHTTPS=E7=9A=84=E5=8C=BA=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/network_address_config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/serverconfigs/network_address_config.go b/pkg/serverconfigs/network_address_config.go index 93371e3..7c8e166 100644 --- a/pkg/serverconfigs/network_address_config.go +++ b/pkg/serverconfigs/network_address_config.go @@ -27,6 +27,14 @@ type NetworkAddressConfig struct { func (this *NetworkAddressConfig) Init() error { this.hostHasVariables = configutils.HasVariables(this.Host) + // 特殊端口自动修复,防止有些小白用户不了解HTTP和HTTPS的区别而选择了错误的协议 + if this.PortRange == "80" && this.Protocol == ProtocolHTTPS { + this.Protocol = ProtocolHTTP + } + if this.PortRange == "443" && this.Protocol == ProtocolHTTP { + this.Protocol = ProtocolHTTPS + } + // 8080 if regexpSinglePort.MatchString(this.PortRange) { this.MinPort = types.Int(this.PortRange)