mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-25 01:23:22 +01:00
0c039274a4
This update adds new relay integration for NetBird clients. The new relay is based on web sockets and listens on a single port. - Adds new relay implementation with websocket with single port relaying mechanism - refactor peer connection logic, allowing upgrade and downgrade from/to P2P connection - peer connections are faster since it connects first to relay and then upgrades to P2P - maintains compatibility with old clients by not using the new relay - updates infrastructure scripts with new relay service
18 lines
1014 B
Go
18 lines
1014 B
Go
/*
|
|
The `healthcheck` package is responsible for managing the health checks between the client and the relay server. It
|
|
ensures that the connection between the client and the server are alive and functioning properly.
|
|
|
|
The `Sender` struct is responsible for sending health check signals to the receiver. The receiver listens for these
|
|
signals and sends a new signal back to the sender to acknowledge that the signal has been received. If the sender does
|
|
not receive an acknowledgment signal within a certain time frame, it will send a timeout signal via timeout channel
|
|
and stop working.
|
|
|
|
The `Receiver` struct is responsible for receiving the health check signals from the sender. If the receiver does not
|
|
receive a signal within a certain time frame, it will send a timeout signal via the OnTimeout channel and stop working.
|
|
|
|
In the Relay usage the signal is sent to the peer in message type Healthcheck. In case of timeout the connection is
|
|
closed and the peer is removed from the relay.
|
|
*/
|
|
|
|
package healthcheck
|