gohooks alternatives and similar packages
Based on the "Networking" category.
Alternatively, view gohooks alternatives based on common mentions on social networks and blogs.
-
kcptun
A Stable & Secure Tunnel based on KCP with N:M multiplexing and FEC. Available for ARM, MIPS, 386 and AMD64。N:M 多重化と FEC を備えた KCP に基づく安定した安全なトンネル。 N:M 다중화 및 FEC를 사용하는 KCP 기반의 안정적이고 안전한 터널입니다. Un tunnel stable et sécurisé basé sur KCP avec multiplexage N:M et FEC. -
fasthttp
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http -
gnet
🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go./ gnet 是一个高性能、轻量级、非阻塞的事件驱动 Go 网络框架。 -
Netmaker
Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks. -
kcp-go
A Crypto-Secure, Production-Grade Reliable-UDP Library for golang with FEC -
netpoll
A high-performance non-blocking I/O networking framework focusing on RPC scenarios. -
mqttPaho
The Paho Go Client provides an MQTT client library for connection to MQTT brokers via TCP, TLS or WebSockets. -
fortio
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats. -
go-getter
Package for downloading things from a string URL using a variety of protocols. -
nbio
Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use. -
gobetween
:cloud: Modern & minimalistic load balancer for the Сloud era -
gev
🚀Gev is a lightweight, fast non-blocking TCP network library / websocket server based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers. -
gmqtt
Gmqtt is a flexible, high-performance MQTT broker library that fully implements the MQTT protocol V3.x and V5 in golang -
easytcp
:sparkles: :rocket: EasyTCP is a light-weight TCP framework written in Go (Golang), built with message router. EasyTCP helps you build a TCP server easily fast and less painful. -
peerdiscovery
Pure-Go library for cross-platform local peer discovery using UDP multicast :woman: :repeat: :woman: -
gaio
High performance async-io(proactor) networking for Golang。golangのための高性能非同期io(proactor)ネットワーキング -
raw
Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed. -
winrm
Command-line tool and library for Windows remote command execution in Go -
arp
Package arp implements the ARP protocol, as described in RFC 826. MIT Licensed. -
go-cleanhttp
Get easily stdlib HTTP client, which does not share any state with other clients. -
ethernet
Package ethernet implements marshaling and unmarshaling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags. MIT Licensed.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of gohooks or a related project?
Popular Comparisons
README
GoHooks
GoHooks make it easy to send and consume secured web-hooks from a Go application. A SHA-256 signature is created with the sent data plus an encryption salt and serves to validate on receiving, effectively making your applications only accept communication from a trusted party.
Installation
Add github.com/averageflow/gohooks/v2
to your go.mod
file and then import it into where you want to be using the package by using:
import (
"github.com/averageflow/gohooks/v2/gohooks"
)
Usage
Here I will list the most basic usage for the GoHooks. If you desire more customization please read the section below for more options.
Sending
The most basic usage for sending is:
// Data can be any type, accepts interface{}
data := []int{1, 2, 3, 4}
// String sent in the GoHook that helps identify actions to take with data
resource := "int-list-example"
// Secret string that should be common to sender and receiver
// in order to validate the GoHook signature
saltSecret := "0014716e-392c-4120-609e-555e295faff5"
hook := &gohooks.GoHook{}
hook.Create(data, resource, salt)
// Will return *http.Response and error
resp, err := hook.Send("www.example.com/hooks")
Receiving
The most basic usage for receiving is:
type MyWebhook struct {
Resource string `json:"resource"`
Data []int `json:"data"`
}
var request MyWebhook
// Assuming you use Gin Gonic, otherwise unmarshall JSON yourself.
_ = c.ShouldBindJSON(&request)
// Shared secret with sender
saltSecret := "0014716e-392c-4120-609e-555e295faff5"
// Assuming you use Gin Gonic, obtain signature header value
receivedSignature := c.GetHeader(gohooks.DefaultSignatureHeader)
// Verify validity of GoHook
isValid := gohooks.IsGoHookValid(request, receivedSignature, saltSecret)
// Decide what to do if GoHook is valid or not.
Customization
GoHooks use the custom header X-GoHooks-Verification
to send the encrypted SHA string. You can customize this header by initializing the GoHook struct with the custom option SignatureHeader
.
Example:
hook := &gohooks.GoHook{ SignatureHeader: "X-Example-Custom-Header" }
GoHooks are by default not verifying the receiver's SSL certificate validity. If you desire this behaviour then enable it by initializing the GoHook struct with the custom option IsSecure
.
Example:
hook := &gohooks.GoHook{ IsSecure: true }
GoHooks will by default be sent via a POST
request. If you desire to use a different HTTP method, amongst the allowed POST
, PUT
, PATCH
, DELETE
, then feel free to pass that option when initializing the GoHook struct, with PreferredMethod
. Any other value will make the GoHook default to a POST
request.
Example:
hook := &gohooks.GoHook{ PreferredMethod: http.MethodDelete }
GoHooks can be sent with additional HTTP headers. If you desire this then initialize the GoHook struct with the custom option AdditionalHeaders
.
Example:
hook := &gohooks.GoHook{ AdditionalHeaders: map[string]string{"X-Header-Test": "Header value"} }
If you want to send your payload without GoHooks modifying it into its struct, use CreateWithoutWrapper
when creating the GoHook.
*Note that all licence references and agreements mentioned in the gohooks README section above
are relevant to that project's source code only.