Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 375 Bytes

README.md

File metadata and controls

27 lines (24 loc) · 375 Bytes

traceroute

golang traceroute

####需要ROOT权限运行

package main

import (
	"fmt"
	"github.com/lixiangzhong/traceroute"
)

func main() {
	t := traceroute.New("qq.com")
	//t.MaxTTL=30
	//t.Timeout=3 * time.Second
	//t.LocalAddr="0.0.0.0"
	result, err := t.Do()
	if err != nil {
		fmt.Println(err)
		return
	}
	for _, v := range result {
		fmt.Println(v)
	}
}