UDP Crusher is a Golang proxy library designed to simulate UDP network conditions. It is inspired by the Toxiproxy project, with code copied and adapted filling the gap for UDP simulation as Toxiproxy primarily focuses on TCP.
upstream := "8.8.8.8:53"
proxy := toxiproxy.NewProxy("proxy-name", "localhost:0", upstream)
proxy.Start()
toxic := &toxics.LatencyToxic{
Latency: 750 // in milliseconds
}
tw := &toxics.ToxicWrapper{
Toxic: toxic,
Name: "latency_up",
Type: "latency",
Direction: stream.Upstream,
}
_ = proxy.Toxics.AddToxic(tw)
// your client application code
_, _ = net.Dial("udp", proxy.Listen)
Currently toxiproxy has already tightly coupled with golang TCP socket API and cannot be extended that easily.
Anyone who develops client/protocol implementations over UDP or applications using above in golang, for example QUIC, Aeron, DNS and etc
UDP Crusher is beneficial for developers working on various aspects of UDP communication, including UDP clients, protocols over UDP, and applications that utilize UDP. Some examples of potential use cases include:
- Implementing and testing QUIC-based applications
- Simulating Aeron network conditions for robustness testing
- Testing DNS communication behavior under different network conditions