void StartWebsockServer(int port, bool bindOnlyToLoopback) { FleckLog.Level = LogLevel.Debug; FleckLog.LogAction = new Fleck2Extensions.Action<LogLevel, string, Exception>(FleckLogger); // Fleck library changed behaviour with recent .NET versions so we have to supply the port in the location string _webSocketServer = new WebSocketServer("ws://localhost:" + port, bindOnlyToLoopback); Action<IWebSocketConnection> config = new Action<IWebSocketConnection>(InitSocket); _webSocketServer.Start(config); }
void StartWebsockServer(int port) { FleckLog.Level = LogLevel.Debug; _webSocketServer = new WebSocketServer("ws://localhost:" + port); Action<IWebSocketConnection> config = new Action<IWebSocketConnection>(InitSocket); _webSocketServer.Start(config); }
public void ShouldNotBeSecureWithoutWssAndCertificate() { var server = new WebSocketServer("ws://secureplace.com:8000"); server.Certificate = new X509Certificate2(); Assert.IsFalse(server.IsSecure); }
public void ShouldNotBeSecureWithWssAndNoCertificate() { var server = new WebSocketServer("wss://secureplace.com:8000"); Assert.IsFalse(server.IsSecure); }
public void Setup() { _repository = new MockRepository(MockBehavior.Default); _server = new WebSocketServer("ws://localhost:8000"); }