Start-HttpServer
1.0.1
Starts a lightweight static file server using the built-in .NET HttpListener class,
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.
The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.
The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
Starts a lightweight static file server using the built-in .NET HttpListener class,
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.
The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
GET and HEAD requests, common content types, directory redirects, and conditional
caching with Last-Modified and If-Modified-Since. Missing paths and requests that
resolve outside SiteRoot return 404.
By default, the server listens on all network interfaces at port 8000, similar to
Python's http.server. Use LocalOnly to restrict access to this computer at
http://localhost:8000/. LAN access requires an elevated PowerShell session and an
enabled inbound Windows Firewall rule for the selected TCP port.
This script is intended for local development, testing, demonstrations, and quick
file sharing. It is not intended to replace a production web server.
Show more
with behavior similar to Python's `python -m http.server` command. No additional
packages or web framework are required.
The server serves files below SiteRoot, returns index.html for directory URLs when
present, and generates a directory listing when no index.html exists. It supports
GET and HEAD requests, common content types, directory redirects, and conditional
caching with Last-Modified and If-Modified-Since. Missing paths and requests that
resolve outside SiteRoot return 404.
By default, the server listens on all network interfaces at port 8000, similar to
Python's http.server. Use LocalOnly to restrict access to this computer at
http://localhost:8000/. LAN access requires an elevated PowerShell session and an
enabled inbound Windows Firewall rule for the selected TCP port.
This script is intended for local development, testing, demonstrations, and quick
file sharing. It is not intended to replace a production web server.
Installation Options
Owners
Package Details
Author(s)
- MrDRamos
Tags
http server web static files python http.server
Functions
Get-LocalLanAddress Test-IsAdministrator Test-LanFirewallPortOpen Get-DirectoryListingHtml Get-ContentType
Dependencies
This script has no dependencies.
Release Notes
Initial release.
FileList
- Start-HttpServer.nuspec
- Start-HttpServer.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.1 (current version) | 5 | 9/12/2026 |
| 1.0.0 | 5 | 9/12/2026 |