Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 void StartWebsockServer(int port)
 {
     FleckLog.Level = LogLevel.Debug;
     _webSocketServer = new WebSocketServer("ws://localhost:" + port);
     Action<IWebSocketConnection> config = new Action<IWebSocketConnection>(InitSocket);
     _webSocketServer.Start(config);
 }
Exemplo n.º 3
0
 public void ShouldNotBeSecureWithoutWssAndCertificate()
 {
     var server = new WebSocketServer("ws://secureplace.com:8000");
     server.Certificate = new X509Certificate2();
     Assert.IsFalse(server.IsSecure);
 }
Exemplo n.º 4
0
 public void ShouldNotBeSecureWithWssAndNoCertificate()
 {
     var server = new WebSocketServer("wss://secureplace.com:8000");
     Assert.IsFalse(server.IsSecure);
 }
Exemplo n.º 5
0
 public void Setup()
 {
     _repository = new MockRepository(MockBehavior.Default);
     _server = new WebSocketServer("ws://localhost:8000");
 }