/// <summary>
 /// Disposes of resources.
 /// </summary>
 public void Dispose()
 {
     if (server != null)
     {
         server.Dispose();
         server = null;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsoleRoute"/> class.
 /// </summary>
 /// <param name="port">The port the websocket should connect on.</param>
 /// <param name="secure">Set to <see langword="true"/> to use a secure websocket server.</param>
 public ConsoleRoute(int port, bool secure)
 {
     server = new WebSocketListener(secure);
     server.DataReceived += HandleDataReceived;
     socketPort           = port.ToString();
     useSecureWebsocket   = secure;
     server.Start(port);
 }