|
| 1 | +<a id="readme-top"></a> |
| 2 | + |
| 3 | +<!-- EliteSoftware Co. LOGO --> |
| 4 | + |
| 5 | +<br /> |
| 6 | +<div align="center"> |
| 7 | +<a href="Logo"> |
| 8 | +<img src="https://i.postimg.cc/85MDTcrJ/Elite-Software-LOGO-Mocup2.png" alt="Logo" width="256" height="256"> |
| 9 | +</a> |
| 10 | +</div> |
| 11 | + |
| 12 | +<!-- ABOUT THE PROJECT --> |
| 13 | + |
| 14 | +# 💾 About The Project <div align="center"> |
| 15 | +## Screenshot may be slightly outdated. Sorry in advance! :) |
| 16 | +<br /> |
| 17 | +<div align="center"> |
| 18 | +<a href="Screenshot"> |
| 19 | +<img src="https://i.postimg.cc/Y9QyWx7m/image.png" alt="GUI Screenshot" width="1280" height="720"> |
| 20 | +</a> |
| 21 | +</div> |
| 22 | + |
| 23 | +EliteSoftware HTML - HTTP Test Server: A Multi-Config GUI for PowerShell |
| 24 | + |
| 25 | +EliteSoftware HTML - HTTP Test Server is a compact, multi-threaded HTTP server application built entirely with PowerShell and Windows Forms (.NET WinForms). It's designed to provide developers and testers with a simple, yet robust, GUI-based platform for quickly hosting and testing local static web content (HTML, CSS, JS, etc.). |
| 26 | + |
| 27 | +This tool allows you to run multiple server configurations simultaneously, each on its own thread, ensuring stability and non-blocking operation. It features a modern, themed GUI, configuration saving, dynamic port checking, and a graceful shutdown mechanism. |
| 28 | + |
| 29 | +Built by: Zachary Whiteman & Google Gemini AI. |
| 30 | + |
| 31 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 32 | + |
| 33 | +<!-- GETTING STARTED --> |
| 34 | + |
| 35 | +# 🔰 Getting Started |
| 36 | +This application is a single PowerShell script and does not require a complex installation process. |
| 37 | + |
| 38 | +## 🕰️ Prerequisites |
| 39 | +To run this script, you only need: |
| 40 | + |
| 41 | +Windows Operating System (Windows 7 or later). |
| 42 | + |
| 43 | +PowerShell 5.1 or newer (PowerShell Core is supported, but the script is optimized for the full .NET Framework available in Windows PowerShell for WinForms). |
| 44 | + |
| 45 | +The required .NET Framework assemblies (System.Windows.Forms, System.Drawing, System.Net) which are included with modern Windows installations and loaded automatically by the script. |
| 46 | + |
| 47 | +## 💽 Installation & Execution |
| 48 | +Download: Download the EliteSoftware HTML - HTTP Test Server.PS1 script file. |
| 49 | + |
| 50 | +Unblock: Right-click the file, go to Properties, and click Unblock if the file was downloaded from the internet (a common necessity for scripts downloaded from the web). |
| 51 | + |
| 52 | +Run: Execute the script from a PowerShell console or by double-clicking it (if your system is configured to run PS1 files). |
| 53 | + |
| 54 | +.\EliteSoftware HTML - HTTP Test Server.PS1 |
| 55 | + |
| 56 | +The application's configuration files and custom icon (if present) are stored in: |
| 57 | +C:\Users\<YourUser>\AppData\Roaming\EliteSoftware\HTML_HTTP_TEST_SERVER |
| 58 | + |
| 59 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 60 | + |
| 61 | +## 🚀 Usage |
| 62 | +The application is designed for rapid local testing via a simple three-step process: |
| 63 | + |
| 64 | +Configure: In the main control panel, specify the Server Root Folder (where your HTML/CSS/JS files are located) and the desired Server Port (e.g., 8080). |
| 65 | + |
| 66 | +Start: Click the "Start Server" button. The application will automatically check for port availability and launch the server on a dedicated thread. |
| 67 | + |
| 68 | +Test: Click the "Open in Browser" button to immediately launch the hosted URL in your default web browser, allowing you to test your content instantly. |
| 69 | + |
| 70 | +Use the left sidebar to save and switch between up to 10 distinct server configurations instantly. |
| 71 | + |
| 72 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 73 | + |
| 74 | +## ✨ Key Features |
| 75 | +This application leverages PowerShell WinForms and multi-threading for a fully-featured desktop experience: |
| 76 | + |
| 77 | +Multi-Server Configuration UI: Manage up to 10 distinct server setups with their own root paths, default files, and ports via an intuitive sidebar and configuration list. |
| 78 | + |
| 79 | +Multi-Threaded HTTP Server: The server logic uses the robust System.Net.HttpListener on a separate background thread, ensuring the GUI remains responsive while handling incoming requests. |
| 80 | + |
| 81 | +Dynamic Port Resolution: Automatically detects and increments the server port by +1 if the specified port is already in use, preventing startup conflicts. |
| 82 | + |
| 83 | +Detailed Real-Time Logging: Logs all successful (200), 404 Not Found, and 500 Server Error requests to the GUI console in real-time. Logs include file size (in KB), client IP, and HTTP method. |
| 84 | + |
| 85 | +Graceful Shutdown: Implements an explicit shutdown routine for all active servers and includes a custom, themed "Goodbye" popup window on exit, ensuring no lingering processes. |
| 86 | + |
| 87 | +Configuration Persistence: Automatically saves and loads all server settings (up to 10 configs) to a JSON file in your AppData folder, maintaining your workflow across sessions. |
| 88 | + |
| 89 | +Browser Integration: Includes a one-click button to open the hosted server URL in the default web browser. |
| 90 | + |
| 91 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 92 | + |
| 93 | +## 🛠️ Technology Stack |
| 94 | +The entire application is a self-contained PowerShell script, utilizing: |
| 95 | + |
| 96 | +Scripting Language: PowerShell (5.1+) |
| 97 | + |
| 98 | +GUI Framework: .NET Windows Forms (WinForms) |
| 99 | + |
| 100 | +Core HTTP Service: System.Net.HttpListener (a high-performance, built-in Windows HTTP service) |
| 101 | + |
| 102 | +Threading: System.Threading.Thread for non-blocking server operation. |
| 103 | + |
| 104 | +GUI Styling: Uses [System.Windows.Forms.Application]::EnableVisualStyles() and System.Drawing.Drawing2D for custom, system-themed buttons and gradient headers. |
| 105 | + |
| 106 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 107 | + |
| 108 | +## 📐 Architecture & Security Notes |
| 109 | + |
| 110 | +This application is built as a highly specialized, local-only test environment. Understanding its architecture is key to proper usage and security: |
| 111 | + |
| 112 | +### 🌎 Local-Only Server (HttpListener) |
| 113 | +The core server functionality is provided by the `.NET System.Net.HttpListener` class. This class is highly optimized for lightweight serving and is configured to: |
| 114 | +* **Prevent Global Access:** The default IP address binding is set to `127.0.0.1` (localhost) to ensure the server is not accidentally accessible from external network connections. This is crucial for security when testing local files. |
| 115 | +* **Static Content Only:** The server is designed exclusively to serve static files (HTML, CSS, JavaScript, images, etc.). It does **not** execute any server-side scripts (like PHP or ASP.NET) and is safe to use for testing front-end components. |
| 116 | + |
| 117 | +### 🔄️ Threading Model |
| 118 | +The GUI runs on the main PowerShell thread, while the `HttpListener` operates on a separate, dedicated `System.Threading.Thread`. This architecture ensures: |
| 119 | +* **Non-Blocking UI:** The user interface remains responsive to clicks and input, even while the server is busy handling requests. |
| 120 | +* **Graceful Exit:** The script uses a global flag (`$Script:IsExiting`) and explicit `Stop()` calls on the listener to guarantee that the server threads are terminated cleanly when the application window is closed. |
| 121 | + |
| 122 | +### 🗃️ Data Handling |
| 123 | +Configuration data for up to 10 servers (root path, port, default file) is stored locally as a simple JSON file in the designated AppData directory. No external connections or databases are used for configuration or logging. |
| 124 | + |
| 125 | +<!-- LICENSE --> |
| 126 | + |
| 127 | +## 🪪 License |
| 128 | +Distributed under the MIT License. See LICENSE.txt for more information. |
| 129 | + |
| 130 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
| 131 | + |
| 132 | +<!-- CONTACT --> |
| 133 | + |
| 134 | +## ☎️ Contact |
| 135 | +Zach Whiteman - elitesoftwarecolimited@gmail.com |
| 136 | + |
| 137 | +HuggingFace - https://huggingface.co/EliteSoftware |
| 138 | + |
| 139 | +HuggingFace (Personal) - https://huggingface.co/TheShadyRainbow |
| 140 | + |
| 141 | +LinkTree - https://linktr.ee/zachrainbow |
| 142 | + |
| 143 | +Patreon - https://www.patreon.com/c/EliteSoftwareCo |
| 144 | + |
| 145 | +<p align="right">(<a href="#readme-top">back to top</a>)</p> |
0 commit comments