mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-13 13:19:06 +00:00
Add a -socket option that configures the server to listen on a Unix-domain socket or Windows named pipe instead of a TCP port. This allows webhook to be used behind a reverse proxy on multi-tenant shared hosting without the need to choose (and the permission to bind to) a free port number. On Windows, -socket is expected to be a named pipe such as \\.\pipe\webhook, and the code uses https://github.com/microsoft/go-winio to bind the listening socket. On other platforms, -socket is the path to a Unix domain socket such as /tmp/webhook.sock, or an abstract socket name starting with @, bound using the regular net.Listen function with the "network" parameter set to "unix". Note: this pushes our minimum Go version up to 1.21 as that is what go-winio requires, but that is already the minimum version against which we are testing in the CI matrix.
22 lines
1.1 KiB
Go
22 lines
1.1 KiB
Go
// This package provides utilities for efficiently performing Win32 IO operations in Go.
|
|
// Currently, this package is provides support for genreal IO and management of
|
|
// - named pipes
|
|
// - files
|
|
// - [Hyper-V sockets]
|
|
//
|
|
// This code is similar to Go's [net] package, and uses IO completion ports to avoid
|
|
// blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines.
|
|
//
|
|
// This limits support to Windows Vista and newer operating systems.
|
|
//
|
|
// Additionally, this package provides support for:
|
|
// - creating and managing GUIDs
|
|
// - writing to [ETW]
|
|
// - opening and manageing VHDs
|
|
// - parsing [Windows Image files]
|
|
// - auto-generating Win32 API code
|
|
//
|
|
// [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service
|
|
// [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-
|
|
// [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images
|
|
package winio
|