Windows Named Pipe Http Echo Server.
This little tool creates a Windows Named Pipe and listens for HTTP requests.
Request bodies will be returned with a prefix
/exit will stop the tool and remove the pipe.
The request method will be ignored, so you can use any of
POST or whatever.
Usage in integration tests
This tool comes in handy when running integration tests. There's no built-in way to create a named pipe in the JVM,
so you end up trying to create some JNI/JNA implementation
to make the syscall.aspx) for you...
or you use a native binary to handle everything for you and simply call it via
You can find my own use case in the integration tests for the Docker Client.
As soon as the project is built on a Windows system, the integration tests verify
the basic ability to use a named pipe socket for communication with the Docker engine.
Yeah, Windows only, but who cares? ¯_(ツ)_/¯
Since Windows Named Pipes are a Windows only concept (similar to Unix Domain Sockets), you would probably expect
Windows specific sources or build configurations. Thanks to Golang this isn't necessary: the cross compiler
works very well and creates a nice Windows native executable. I'm a fan of automation, which is why
you'll always find the most recent version of this tool on the Docker Hub, packaged as Docker image.
The Docker image isn't expected to be run, but it serves to leverage the build and distribution of this tool.
See below for details!
go get -d github.com/gesellix/go-npipe CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o npipe.exe main.go
docker create --name npipe gesellix/npipe docker cp npipe:/npipe.exe . docker rm npipe
List pipes (PowerShell)