Esempio n. 1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            int externalPort = 0;
            int internalPort = 0;

            //Validation
            int.TryParse(txtExternalPort.Text, out externalPort);
            int.TryParse(txtInternalPort.Text, out internalPort);
            if (!checkPortRange(externalPort) ||
                !checkPortRange(internalPort) ||
                externalPort == internalPort)
            {
                showError("Ports must be between " + MIN_PORT + "-" + MAX_PORT + " and must not be the same.");
                return;
            }
            if (!checkPortAvailability(externalPort))
            {
                showError("Port " + externalPort + " is not available, please select a different port.");
                return;
            }

            ProxyThreadListener = new ProxyThread(externalPort, internalPort, chkRewriteHostHeaders.Checked);

            toggleButtons();
        }
Esempio n. 2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            int externalPort = 0;
            int internalPort = 0;
            //Validation
            int.TryParse(txtExternalPort.Text, out externalPort);
            int.TryParse(txtInternalPort.Text, out internalPort);
            if (!checkPortRange(externalPort)
                || !checkPortRange(internalPort)
                || externalPort == internalPort)
            {
                showError("Ports must be between " + MIN_PORT + "-" + MAX_PORT + " and must not be the same.");
                return;
            }
            if (!checkPortAvailability(externalPort))
            {
                showError("Port " + externalPort + " is not available, please select a different port.");
                return;
            }

            ProxyThreadListener = new ProxyThread(externalPort, internalPort, chkRewriteHostHeaders.Checked);

            toggleButtons();
            showQRCode();
        }