peerdiscovery alternatives and similar packages
Based on the "Networking" category.
Alternatively, view peerdiscovery alternatives based on common mentions on social networks and blogs.
-
fasthttp
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http -
Netmaker
Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks. -
gnet
๐ gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go. -
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. -
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. -
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. -
raw
DISCONTINUED. Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed. -
ethernet
Package ethernet implements marshaling and unmarshaling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags. MIT Licensed. -
buffstreams
A library to simplify writing applications using TCP sockets to stream protobuff messages
CodeRabbit: AI Code Reviews for Developers
Do you think we are missing an alternative of peerdiscovery or a related project?
README
peerdiscovery
Pure-go library for cross-platform thread-safe local peer discovery using UDP multicast. I needed to use peer discovery for croc and everything I tried had problems, so I made another one.
Install
Make sure you have Go 1.5+.
go get -u github.com/schollz/peerdiscovery
Usage
The following is a code to find the first peer on the local network and print it out.
discoveries, _ := peerdiscovery.Discover(peerdiscovery.Settings{Limit: 1})
for _, d := range discoveries {
fmt.Printf("discovered '%s'\n", d.Address)
}
Here's the output when running on two computers. (Run these gifs in sync by hitting Ctl + F5).
Computer 1:
Computer 2:
For more examples, see the scanning examples (ipv4 and ipv6) or the docs.
Testing
To test the peer discovery with just one host, one can launch multiple containers. The provided Dockerfile
will run the example code.
Please make sure to enable Docker's IPv6 support if you are using IPv6 for peer discovery.
# Build the container, named peertest
$ docker build -t peertest .
# Execute the following command in multiple terminals
$ docker run -t --rm peertest
Scanning for 10 seconds to find LAN peers
100% |โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| [9s:0s]Found 1 other computers
0) '172.17.0.2' with payload 'zqrecHipCO'
Contributing
Pull requests are welcome. Feel free to...
- Revise documentation
- Add new features
- Fix bugs
- Suggest improvements
Thanks
Thanks @geistesk for adding IPv6 support and a Notify
func, and helping maintain! Thanks @Kunde21 for providing a bug fix and massively refactoring the code in a much better way. Thanks @robpre for finding and fixing bugs. Thanks @shvydky for adding dynamic payloads.
License
MIT
*Note that all licence references and agreements mentioned in the peerdiscovery README section above
are relevant to that project's source code only.