From 39cbd2d1daf279b562f53dbf79e450dd773eee69 Mon Sep 17 00:00:00 2001 From: Mateleo Date: Fri, 22 Nov 2024 21:35:36 +0100 Subject: [PATCH] test --- src/DiIiS-NA/BGS-Server/Base/ConnectHandler.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/DiIiS-NA/BGS-Server/Base/ConnectHandler.cs b/src/DiIiS-NA/BGS-Server/Base/ConnectHandler.cs index df4b1bb..970f918 100644 --- a/src/DiIiS-NA/BGS-Server/Base/ConnectHandler.cs +++ b/src/DiIiS-NA/BGS-Server/Base/ConnectHandler.cs @@ -355,19 +355,12 @@ namespace DiIiS_NA.LoginServer.Base private static string GetWebSocketLocation(IChannelPipeline cp, IHttpRequest req, string path) { - string str = "ws"; - if (cp.Get() != null) - { - str = "wss"; - } + string protocol = cp.Get() != null ? "wss" : "ws"; - string str2 = null; - if (req.Headers.TryGet(HttpHeaderNames.Host, out ICharSequence value)) - { - str2 = value.ToString(); - } + // Ignore the Host header and default to a placeholder or IP address + string host = "192.168.1.100"; // Replace with your desired default host, e.g., the server's IP or DNS. - return str + "://" + str2 + path; + return $"{protocol}://{host}{path}"; } } }