Skip to content

Instantly share code, notes, and snippets.

@latsku
Last active January 25, 2024 09:10
Show Gist options
  • Save latsku/c5a6f14a2b95e0a602606a021fd43c3e to your computer and use it in GitHub Desktop.
Save latsku/c5a6f14a2b95e0a602606a021fd43c3e to your computer and use it in GitHub Desktop.
Powershell TCP server
$endpoint = New-Object System.Net.IPEndPoint ([System.Net.IPAddress]::any, 1600)
$Listener = New-Object System.Net.Sockets.TcpListener $endpoint
$Listener.Start()
$client = $Listener.AcceptTcpClient()
$stream = $client.GetStream()
$stream.Write([text.Encoding]::Ascii.GetBytes("Hello Telnet World"), 0, 18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment