Skip to content

Go Engine

Phong Võ edited this page Mar 21, 2026 · 1 revision

⚙️ Go Engine

Overview

Go engine là CLI binary xử lý tất cả network operations. UI giao tiếp với engine qua:

  • Input: Config JSON file (temp file)
  • Output: JSON lines trên stdout
  • Diagnostics: Text trên stderr

Commands

Command File Description
loadtest cmd_loadtest.go HTTP load testing
ping cmd_ping.go TCP ping
traceroute cmd_traceroute.go Route tracing
dns cmd_dns.go DNS record lookup
portscan cmd_portscan.go TCP port scanning
ipscan cmd_ipscan.go Subnet IP scanning
httpheaders cmd_httpheaders.go HTTP response headers
ssl cmd_ssl.go SSL certificate check
geoip cmd_geoip.go IP geolocation
whois cmd_whois.go Domain WHOIS/RDAP
websocket cmd_websocket.go WebSocket test

Usage

./engine.exe <command> <config.json>

Concurrency Patterns

Worker Pool (portscan, ipscan)

portCh := make(chan int, len(ports))
var wg sync.WaitGroup
for i := 0; i < workers; i++ {
    wg.Add(1)
    go func() { defer wg.Done(); /* scan */ }()
}

Graceful Shutdown

ctx, cancel := context.WithCancel(context.Background())
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
go func() { <-sigCh; cancel() }()

Dependencies

  • stdlib only — no external Go modules
  • Standard net, net/http, crypto/tls, encoding/json

Clone this wiki locally