示例#1
0
        public WSConfigPanel(TinyIoCContainer container)
        {
            InitializeComponent();

            _config   = container.Resolve <IPluginConfig>();
            _server   = container.Resolve <WSServer>();
            _plugin   = container.Resolve <PluginMain>();
            _registry = container.Resolve <Registry>();


            ipTxt.Text     = _config.WSServerIP;
            portTxt.Text   = "" + _config.WSServerPort;
            sslBox.Checked = _config.WSServerSSL;
            sslBox.Enabled = _server.IsSSLPossible();

            for (var i = 0; i < regionCb.Items.Count; i++)
            {
                if ((string)regionCb.Items[i] == _config.TunnelRegion)
                {
                    regionCb.SelectedIndex = i;
                    break;
                }
            }

            UpdateStatus(null, new WSServer.StateChangedArgs(_server.IsRunning(), _server.IsFailed()));
            _server.OnStateChanged += UpdateStatus;

            UpdateTunnelStatus(TunnelStatus.Inactive);

            lblUrlConfidentWarning.Visible = false;
        }
示例#2
0
        private void simpStopBtn_Click(object sender, EventArgs e)
        {
            try
            {
                simpLogBox.AppendText("\r\nStopping tunnel...\r\n");

                if (_ngrok != null && !_ngrok.HasExited)
                {
                    _ngrok.Kill();
                    _ngrok = null;
                }

                _ngrokPrefix = null;

                simpLogBox.AppendText("Stopping WSServer...\r\n");
                if (_server.IsRunning())
                {
                    _server.Stop();
                }

                simpLogBox.AppendText("Done!\r\n");
                UpdateTunnelStatus(TunnelStatus.Inactive);
            } catch (Exception ex)
            {
                simpLogBox.AppendText(string.Format("\r\nFailed: {0}\r\n\r\n", ex));
                UpdateTunnelStatus(TunnelStatus.Error);
            }
        }
示例#3
0
        public WSConfigPanel(PluginConfig cfg)
        {
            InitializeComponent();

            Config         = cfg;
            ipTxt.Text     = Config.WSServerIP;
            portTxt.Text   = "" + Config.WSServerPort;
            sslBox.Checked = Config.WSServerSSL;
            sslBox.Enabled = WSServer.IsSSLPossible();

            UpdateStatus(null, new WSServer.StateChangedArgs(WSServer.IsRunning(), WSServer.IsFailed()));
            WSServer.OnStateChanged += UpdateStatus;
        }
示例#4
0
        public WSConfigPanel(PluginConfig cfg)
        {
            InitializeComponent();

            Config         = cfg;
            ipTxt.Text     = Config.WSServerIP;
            portTxt.Text   = "" + Config.WSServerPort;
            sslBox.Checked = Config.WSServerSSL;
            sslBox.Enabled = WSServer.IsSSLPossible();

            UpdateStatus(null, new WSServer.StateChangedArgs(WSServer.IsRunning(), WSServer.IsFailed()));
            WSServer.OnStateChanged += UpdateStatus;

            lblUrlConfidentWarning.Visible = false;
            Registry.Resolve <PluginMain>().OverlaysChanged += (o, e) =>
            {
                RebuildOverlayOptions();
            };
        }