This commit is contained in:
jsaey
2023-11-17 09:43:03 +01:00
parent cbfb1a9407
commit bcc9a6d44c
69 changed files with 1149 additions and 1461 deletions

View File

@@ -8,7 +8,7 @@ using System.Security.Cryptography.X509Certificates;
internal class Program
{
private static WebSocket _client;
private static WSClient _client;
private static WSServer _server;
private static async Task Main(string[] args)
@@ -66,8 +66,8 @@ internal class Program
StartServer(serverUri, certificatePath, certificatePassword, requiredPassword);
// Start the client in the main thread
_client = new WebSocket(clientUri);
_client.SslConfiguration.Certificates.Add(new X509Certificate(certificatePath, certificatePassword));
_client = new WSClient(clientUri);
_client.SSL.Certificates.Add(new X509Certificate(certificatePath, certificatePassword));
_client.OnConnect += (sender, e) => Console.WriteLine($"Connected to server");
_client.OnMessageReceived += (sender, e) => Console.WriteLine($"Received message from server: {e.Data}");
_client.OnDisconnect += (sender, e) => Console.WriteLine($"Disconnected from server: {e.Code} : {e.Reason}");