Here's an example code snippet that uses gopacket library to intercept and relay UDP packets while injecting the HAPROXY protocol header:
main.go1937 chars91 linesNote: This is a basic example, and you may want to customize it based on your specific use case.
gistlibby LogSnag