This is a simple HTTP server based on PowerShell, demonstrating how to create and deploy a lightweight web server. The server listens for requests on a specified port and returns a designated HTML file.
- Supports basic HTTP request handling.
- Logging functionality.
- Can be run as a Windows service.
The installation script install_psttc.ps1 will install the program into the C:\Program Files\PSTTC directory and create shortcuts on the desktop and in the Start Menu.
.\install_psttc.ps1Double-click the shortcut on your desktop or in the Start Menu to start the server.
.\psttc.exe [htmlFile]Where [htmlFile] is an optional parameter; the default is ./www/index.html.
Run the -help parameter to view the usage information:
.\psttc.exe -help- Port: The default listening port is 8001. You can change this by modifying the
$portvariable in the source code. - Log File: The default log file is
access.log, located in theC:\Program Files\PSTTCdirectory.
To uninstall the program, delete the installation directory C:\Program Files\PSTTC along with the shortcuts on the desktop and in the Start Menu.
rmdir /s /q "C:\Program Files\PSTTC"If the program has been registered as a Windows service, you can manage the service using the following commands:
sc start PSTTCWebServersc stop PSTTCWebServersc delete PSTTCWebServerIf you encounter any issues or have any suggestions while using the program, please contact the development team.
This project is released under the MIT License. See the LICENSE file for details.
This document is written by the development team. Please refer to the latest version for updates.