Skip to content

Instantly share code, notes, and snippets.

@Tim-S
Tim-S / poshttp.ps1
Last active December 7, 2024 12:40 — forked from andrii-riabchun/poshttp.ps1
Powershell static http server
#Requires -RunAsAdministrator
# Simple static http server.
Param(
[int]$port = 8080,
[string]$root = (Get-Location)
)
function Serve {
$listener = [System.Net.HttpListener]::new()
$listener.Prefixes.Add("http://+:$port/")
@Tim-S
Tim-S / wsClient.html
Created July 20, 2022 17:15
Powershell WebSocket Echoserver
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://localhost:5001/";
var output;
function init() {
output = document.getElementById("output");
@Tim-S
Tim-S / wsClient.html
Last active November 3, 2024 04:13
Simple PowerShell Websocket server
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://localhost:5001/";
var output;
function init() {
output = document.getElementById("output");