{"repo":"tevino/tcp-shaker","free":true,"listed":false,"github":"https://github.com/tevino/tcp-shaker","clone":"git clone https://github.com/tevino/tcp-shaker.git","description":":heartbeat: Perform TCP handshake without ACK in Go, useful for health check, that is SYN, SYN-ACK, RST.","language":"Go","stars":421,"topics":["tcp","handshake","linux","golang","golang-library","golang-package","ack","health-check","network","haproxy"],"license":"MIT","category":"dev-tools","readme_excerpt":"TCP Checker :heartbeat: This package is used to perform TCP handshake without ACK, which useful for TCP health checking. HAProxy does this exactly the same, which is: 1. SYN 2. SYN-ACK 3. RST This implementation has been running on tens of thousands of production servers for years. Why do I have to do this In most cases when you establish a TCP connection(e.g. via net.Dial ), these are the first three packets between the client and server([TCP three-way handshake][tcp-handshake]): 1. Client - Server: SYN 2. Server - Client: SYN-ACK 3. Client - Server: ACK This package tries to avoid the last ACK when doing handshakes. By sending the last ACK, the connection is considered established. However, as for TCP health checking the server could be considered alive right after it sends back SYN-ACK, that renders the last ACK unnecessary or even harmful in some cases. Benefits By avoiding the last ACK 1. Less packets better efficiency 2. The health checking is less obvious The second one is essential because it bothers the server less. This means the application level server will not notice the health checking traffic at all, thus the act of health checking will not be considered as some misbehavior of client. Requirements - Linux 2.4 or newer There is a fake implementation for non-Linux platform which is equivalent to: The reason for a fake implementation is that there is currently no way to perform an equivalent operation on certain platforms, specifically macOS. A fake implementation","default_branch":null,"files":null,"tree":[],"storefront":"/r/tevino","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tevino/tcp-shaker/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}