You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did anyone manage to use the NativeWebSocket/ClientWebSocket through a proxy?
Basically I tried to set the Proxy property from the ClientWebSocketOptions but the client does't connect to the server. It's giving me a 'Unable to connect to the remote server' error.
Here's my code snippet:
varsource=new CancellationTokenSource();vartoken= source.Token;varsocket=new ClientWebSocket();
WebRequest.DefaultWebProxy =new WebProxy(proxyUrl,false);// I tried to set the DefaultWebProxy too, but I get the same error
socket.Options.Proxy =new WebProxy(proxyUrl,false);await socket.ConnectAsync(uri, token);
It works in .NET5 but not in Unity.
Any insights or suggestions on resolving this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
@Robert-96 found a solution , create the stream yourself using tcpclient and then call WebSocket.CreateClientWebSocket in order to create websocket connection
Did anyone manage to use the
NativeWebSocket
/ClientWebSocket
through a proxy?Basically I tried to set the
Proxy
property from theClientWebSocketOptions
but the client does't connect to the server. It's giving me a 'Unable to connect to the remote server' error.Here's my code snippet:
It works in .NET5 but not in Unity.
Any insights or suggestions on resolving this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: