Go

PortSweeper

GitHub repo

A weekend project to scratch an itch: I wanted a port sweeper with sharp jagged edges removed and readable output, written in Go.

Design goals

How it works

Fan-out, fan-in: a stream of host and port pairs is distributed across a fixed pool of workers, and results are collected on a single channel.

results := make(chan ScanResult, 2048)
for i := 0; i < workers; i++ {
  go func() {
    for target := range targets {
      results <- probe(target)
    }
  }()
}

What’s next

Back to projects