Fixed bug where proxy would not get set if you didn't give a session token for the Sneedchat client

This commit is contained in:
barelyprofessional
2024-09-22 14:32:07 +08:00
parent 88b8f20981
commit 8786ceb248

View File

@@ -70,6 +70,10 @@ public class ChatClient
var factory = new Func<ClientWebSocket>(() =>
{
var clientWs = new ClientWebSocket();
if (_config.Proxy != null)
{
clientWs.Options.Proxy = new WebProxy(_config.Proxy);
}
// Guest mode
if (_config.XfSessionToken == null)
{
@@ -79,10 +83,6 @@ public class ChatClient
var cookieContainer = new CookieContainer();
cookieContainer.Add(new Cookie("xf_session", _config.XfSessionToken, "/", _config.CookieDomain));
clientWs.Options.Cookies = cookieContainer;
if (_config.Proxy != null)
{
clientWs.Options.Proxy = new WebProxy(_config.Proxy);
}
return clientWs;
});