rate-limiting-network

command
v0.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

Network Rate Limiting

This example demonstrates network-level rate limiting by source IP address.

Running the Example

go run github.com/dioad/net/examples/rate-limiting-network

Or build and run:

cd examples/rate-limiting-network
go build
./rate-limiting-network

Then test with a TCP client:

nc localhost 8080
# or
telnet localhost 8080

What It Demonstrates

  • Creating a generic rate limiter for network connections
  • Wrapping a listener with rate limiting
  • Rate limiting by source IP address
  • Interactive TCP echo server with rate limiting
  • Graceful shutdown handling

Code

See main.go for the complete executable example.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL