github.com/nxtrace/NTrace-core@v1.3.1-0.20240513132635-39169291e8c9/fast_trace/fast_trace_test.go (about) 1 package fastTrace 2 3 import ( 4 "testing" 5 ) 6 7 func TestTrace(t *testing.T) { 8 //pFastTrace := ParamsFastTrace{ 9 // SrcDev: "", 10 // SrcAddr: "", 11 // BeginHop: 1, 12 // MaxHops: 30, 13 // RDns: false, 14 // AlwaysWaitRDNS: false, 15 // Lang: "", 16 // PktSize: 52, 17 //} 18 //ft := FastTracer{ParamsFastTrace: pFastTrace} 19 //// 建立 WebSocket 连接 20 //w := wshandle.New() 21 //w.Interrupt = make(chan os.Signal, 1) 22 //signal.Notify(w.Interrupt, os.Interrupt) 23 //defer func() { 24 // w.Conn.Close() 25 //}() 26 //fmt.Println("TCP v4") 27 //ft.TracerouteMethod = trace.TCPTrace 28 //ft.tracert(TestIPsCollection.Beijing.Location, TestIPsCollection.Beijing.EDU) 29 //fmt.Println("TCP v6") 30 //ft.tracert_v6(TestIPsCollection.Beijing.Location, TestIPsCollection.Beijing.EDU) 31 //fmt.Println("ICMP v4") 32 //ft.TracerouteMethod = trace.ICMPTrace 33 //ft.tracert(TestIPsCollection.Beijing.Location, TestIPsCollection.Beijing.EDU) 34 //fmt.Println("ICMP v6") 35 //ft.tracert_v6(TestIPsCollection.Beijing.Location, TestIPsCollection.Beijing.EDU) 36 }