Skip to content

Instantly share code, notes, and snippets.

@GitHub30
Last active October 1, 2022 13:36
Show Gist options
  • Save GitHub30/a0be46a0c205435d1b0b91451d5b1617 to your computer and use it in GitHub Desktop.
Save GitHub30/a0be46a0c205435d1b0b91451d5b1617 to your computer and use it in GitHub Desktop.
$listener = new-object Net.HttpListener
# curl localhost/Temporary_Listen_Addresses
$listener.Prefixes.Add("http://+:80/Temporary_Listen_Addresses/")
#$listener.Prefixes.Add("http://localhost:8888/")
$listener.Start()
while ($true)
{
$context = $listener.GetContext()
echo $context.Request
$context.Response.OutputStream.Close()
}
$listener.Stop()
$listener.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment