Cannot connect trough proxy in C# using websocket

357 Views Asked by At

When I try to use proxy in my web socket sharp client it says "An invalid proxy authentication challenge is specified.", even if proxy credentials are correct, if I try to set that proxy as browser proxy it works fine. What could be the problem?

My code:

        static WebSocket socket;

        socket = new WebSocket("ws://" + "example.com:8080", "guacamole");
        socket.OnClose += OnClose;
        socket.OnOpen += OnOpen;
        socket.OnMessage += OnMessage;
        socket.Compression = CompressionMethod.Deflate;

        socket.SetProxy("http://" + "exampleproxy.com:31112", proxyUser, proxyPass);

        socket.Connect();
0

There are 0 best solutions below