diff --git a/TelegramCore/Network.swift b/TelegramCore/Network.swift index 5b49950e4b..b3b9b4e0dd 100644 --- a/TelegramCore/Network.swift +++ b/TelegramCore/Network.swift @@ -337,7 +337,7 @@ func initializedNetwork(arguments: NetworkInitializationArguments, supplementary apiEnvironment = apiEnvironment.withUpdatedLangPackCode(languageCode ?? "en") if let effectiveActiveServer = proxySettings?.effectiveActiveServer { - apiEnvironment = apiEnvironment.withUpdatedSocksProxySettings(MTSocksProxySettings(ip: activeServer.host, port: UInt16(activeServer.port), username: activeServer.username, password: activeServer.password)) + apiEnvironment = apiEnvironment.withUpdatedSocksProxySettings(MTSocksProxySettings(ip: effectiveActiveServer.host, port: UInt16(effectiveActiveServer.port), username: effectiveActiveServer.username, password: effectiveActiveServer.password)) } let context = MTContext(serialization: serialization, apiEnvironment: apiEnvironment)!