All Projects → MScholtes → WebServer

MScholtes / WebServer

Licence: other
Powershell WebServer is a Powershell module that starts a webserver (without the need for IIS)

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to WebServer

mf-chsdi3
api3.geo.admin.ch source code.
Stars: ✭ 35 (+29.63%)
Mutual labels:  webserver
DevCeption
Inception Style (Docker inside Vagrant inside Host) Development Environment
Stars: ✭ 13 (-51.85%)
Mutual labels:  webserver
learn undertow
learn undertow
Stars: ✭ 27 (+0%)
Mutual labels:  webserver
foxpages
Visual FoxPro Multithread Web Server
Stars: ✭ 22 (-18.52%)
Mutual labels:  webserver
DSMRloggerWS
New firmware for the DSMRlogger heavily using WebSockets and Javascript
Stars: ✭ 29 (+7.41%)
Mutual labels:  webserver
SimpleWebServer
TinyWebServer的cpp11实现,代码精简,注释详尽,比原版更容易阅读上手!新增文件上传与下载功能!
Stars: ✭ 67 (+148.15%)
Mutual labels:  webserver
Kvantum
An intellectual (HTTP/HTTPS) web server with support for server side templating (Crush, Apache Velocity and JTwig)
Stars: ✭ 17 (-37.04%)
Mutual labels:  webserver
django-http2-middleware
⚡️Django middleware to automatically send preload headers before views runs, enabling faster HTTP2 server-push (with CSP support).
Stars: ✭ 65 (+140.74%)
Mutual labels:  webserver
hasses
Hyper's Asynchronous Server Sent event (SSE) notification Server
Stars: ✭ 18 (-33.33%)
Mutual labels:  webserver
httplab
The interactive web server
Stars: ✭ 3,856 (+14181.48%)
Mutual labels:  webserver
XProc-Z
A platform for running XProc pipelines as web applications in a Java servlet container
Stars: ✭ 20 (-25.93%)
Mutual labels:  webserver
cookiecutter-esp32-webserver
Cookiecutter template to get you quickly started with an ESP32-based webserver project.
Stars: ✭ 13 (-51.85%)
Mutual labels:  webserver
HttpServerLite
TCP-based simple HTTP and HTTPS server, written in C#.
Stars: ✭ 44 (+62.96%)
Mutual labels:  webserver
webfr
moved to: https://github.com/godzillaframework/godzilla.git
Stars: ✭ 13 (-51.85%)
Mutual labels:  webserver
mongoose
Embedded Web Server
Stars: ✭ 8,968 (+33114.81%)
Mutual labels:  webserver
asws
Another static web server, plus JSON REST API for exposing specified directory listings. Useful for download pages or listings asset for web applications.
Stars: ✭ 21 (-22.22%)
Mutual labels:  webserver
wine
A lightweight and flexible framework to help build elegant web API
Stars: ✭ 39 (+44.44%)
Mutual labels:  webserver
fcgi-function
A cross-platform module to writing C/C++ service for nginx.
Stars: ✭ 33 (+22.22%)
Mutual labels:  webserver
httpsify
a transparent HTTPS termination proxy using letsencrypt with auto certification renewal
Stars: ✭ 107 (+296.3%)
Mutual labels:  webserver
Jarvis
APL-based web service framework supporting JSON or REST
Stars: ✭ 17 (-37.04%)
Mutual labels:  webserver

Powershell Webserver

Powershell WebServer is a module that starts a webserver (without the need for IIS). Powershell command execution, script execution, upload, download and other functions are implemented.

See Script Center version: Powershell Webserver.

Author: Markus Scholtes

Module version: 1.0.5 / 2022-07-31

Script version: 1.4 / 2022-07-31

Installation

Install with

Install-Module WebServer

or download manually here

Now also on Powershell Gallery as part of the SysAdminsFriends module, see here or install with

Install-Module SysAdminsFriends

Project page on github is here.

Description

The .Net class System.Net.HttpListener delivers a basic web service without the need to install a webserver (IIS) role. Since we can use it in C#, we can do it with powershell too (and even without pain).

There are several examples of powershell webservers in the internet, but for me it seems they all have the same origin. Thank you, original coder, whoever you are! My impulse to write a powershell webserver was a short but very impressing example on powershell.com (that unfortunately is no longer online).

The module WebServer implements a webserver with the following functions:

  • a powershell command execution web form
  • powershell script upload and execution (as a function)
  • download files from the server
  • upload files to the server
  • script execution and embedded code with psp files
  • make the webserver beep (to find servers in the datacenter)
  • show webserver logs
  • show server starttime and current time
  • stop the webserver
  • deliver static content based on the script's directory if none of the commands above is requested

The webserver responds to GET methods only except the POST upload and download functionalities (implementing this really did hurt).

Other functions can be implemented very easily.

If you give it a try, see remarks below by all means.

Versions

1.0.5 / 2022-07-31

  • Introduced PSP files (Powershell Server Pages) for embedded execution
  • Updated list of mime types

1.0.4 / 2022-04-15

  • Logs response code
  • Scripts (.ps1, .bat and .cmd) in web directory are executed by web server

1.0.3 / 2022-01-19

  • Load index file in base dir instead of default page when present

1.0.2 / 2021-07-04

  • Updated list of mime types

1.0.1 / 2021-02-21

  • Updated links since Technet Gallery shut down

1.0.0 / 2020-06-04

  • Initial release

Examples:

Start webserver with binding to http://localhost:8080/:

Start-Webserver

Start webserver with binding to all IP addresses of the system and port 8080. Administrative rights are necessary:

Start-Webserver "http://+:8080/"

Screen Console

Start powershell webserver as scheduled task as user local system every time the computer starts:

schtasks.exe /Create /TN "Powershell Webserver" /TR "powershell -Command \"Start-Webserver http://+:8080/\"" /SC ONSTART /RU SYSTEM /RL HIGHEST /F

You can start the webserver task manually with

schtasks.exe /Run /TN "Powershell Webserver"

Delete the webserver task with

schtasks.exe /Delete /TN "Powershell Webserver"

(Scheduled tasks are always running with low priority, so some functions might be slow)

Screen Browser

Embedded code

You can embed powershell code in html files with psp files ("Powershell Server Pages"). Psp files are html files in which the switch code <% toggles to powershell code and %> toggles back to html.

Screen Browser

Remarks

Firewall

You may have to configure a firewall exception to allow access to the chosen port, e.g. with:

netsh advfirewall firewall add rule name="Powershell Webserver" dir=in action=allow protocol=TCP localport=8080

After stopping the webserver you should remove the rule, e.g.:

netsh advfirewall firewall delete rule name="Powershell Webserver"

How to enable https encryption

You can also let the Powershell Webserver deliver encrypted traffic. For a description look here.

Security

There is no security!!! Once started the webserver can be accessed by everyone and everyone can do on the webserver system what you can do.

Download / Upload of large files

There is no optimization for large file download or uploads (no chunking or similiar techniques). The transfer of large files might work, or might not.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].