Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add non-tls socket for webui #2565

Merged
merged 1 commit into from Aug 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 16 additions & 5 deletions PoGo.NecroBot.CLI/WebSocketInterface.cs
Expand Up @@ -12,6 +12,7 @@
using SuperSocket.SocketBase.Config;
using SuperSocket.WebSocket;
using System;
using System.Collections.Generic;

#endregion

Expand All @@ -31,19 +32,29 @@ public WebSocketInterface(int port, Session session)
var translations = session.Translation;
_server = new WebSocketServer();
_websocketHandler = WebSocketEventManager.CreateInstance();
var setupComplete = _server.Setup(new ServerConfig
var config = new ServerConfig
{
Name = "NecroWebSocket",
Ip = "Any",
Port = port,
Mode = SocketMode.Tcp,
Security = "tls",
Certificate = new CertificateConfig
{
FilePath = @"cert.pfx",
Password = "necro"
},
};
config.Listeners = new List<ListenerConfig>
{
new ListenerConfig()
{
Ip = "Any", Port = port, Security = "tls"
},
new ListenerConfig()
{
Ip = "Any", Port = port + 1, Security = "none"
}
});
};

var setupComplete = _server.Setup(config);

if (setupComplete == false)
{
Expand Down