✅ RestSharp not using / ignoring given proxy

Hey, I wanted to ask if anyone here has experience with RestSharp and can help me fix this issue, for longer now i have noticed that my C# script is ignoring the proxy im giving to it
I made sure that its the correct proxy and correct protocol, yet somehow my function returns my real IP address and not the given proxy
        public string currentProxy(string _proxy, int port)
        {
            try
            {

                RestClient client = new RestClient();
                if (_proxy != null) { client.Options.Proxy = new WebProxy("socks5://" + proxy, port); }



                Console.WriteLine(proxy);
                var response = client.ExecuteGet(request: new RestRequest("https://ifconfig.me"));
                if ((int)response.StatusCode != 200)
                {
                    Console.WriteLine((int)response.StatusCode);
                    return null;
                }
                return response.Content.Replace("\n", "");

            } catch { return null; }
        }
image.png
Was this page helpful?