Simple Hypertext Transfer Protocol (HTTP) Web Server.
        /// <summary>
        /// Provides a one-time, preprocessing functionality for the cmdlet.
        /// </summary>
        protected override void BeginProcessing()
        {
            // Work in progress
            if (!this.Interactive)
            {
                this.WriteWarning("Currently, the cmdlet only supports -Interactive mode. Please run again with this switch.");
                return;
            }

            // Initialize parameters and base Incog cmdlet components
            this.InitializeComponent();

            // Default the port if not specified
            if (this.TCP == 0) this.TCP = 80;

            // Start the web server
            this.server = new HttpServer(this.Passphrase, this.LocalAddress, this.TCP);
            this.thread = new Thread(new ThreadStart(this.server.Start));
            this.thread.IsBackground = true;
            this.thread.Start();

            // Invoke Interative Mode if selected
            if (this.Interactive) this.InteractiveMode();
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpProcessor" /> class.
 /// </summary>
 /// <param name="socket">Pass in the client socket.</param>
 /// <param name="server">Pass in the HTTP server.</param>
 public HttpProcessor(TcpClient socket, HttpServer server)
 {
     this.Socket = socket;
     this.Server = server;
     this.Headers = new Hashtable();
 }