socket.io-client-csharp
socket.io-client-csharp copied to clipboard
Unity SocketIOClient cannot connect SSL Server on Android
Unity Error,how to pass SSL errors
Assets\Socket_Manager.cs(107,28): error CS0029: Cannot implicitly convert type 'System.Net.WebSockets.ClientWebSocket' to 'SocketIOClient.Transport.IClientWebSocket'
client = new SocketIOUnity("wss://xxxx", new SocketIOOptions
{
ReconnectionAttempts = 5,
});
client.ClientWebSocketProvider = () =>
{
var clientWebSocket = new ClientWebSocket();
clientWebSocket.Options.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) =>
{
Console.WriteLine("SslPolicyErrors: " + sslPolicyErrors);
return true;
};
return clientWebSocket;
};
The new version was released. if you want to ignore ssl validation:
var io = new SocketIO("https://localhost:11404", new SocketIOOptions
{
RemoteCertificateValidationCallback = (_, _, _, _) =>
{
return true;
}
});
I use this code ,still cannot coonect to the Socket Server。how can i fix?
var io = new SocketIO("https://localhost:11404", new SocketIOOptions { RemoteCertificateValidationCallback = (_, _, _, _) => { return true; } });
Sorry. I'm too late.
First try to update lib to latest version, if you still blocked by compiling errors. please show error messages