mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
26 lines
493 B
Go
26 lines
493 B
Go
package fastTrace
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
"testing"
|
|
|
|
"github.com/xgadget-lab/nexttrace/trace"
|
|
"github.com/xgadget-lab/nexttrace/wshandle"
|
|
)
|
|
|
|
// ICMP Use Too Many Time to Wait So we don't test it.
|
|
func TestTCPTrace(t *testing.T) {
|
|
ft := FastTracer{}
|
|
// 建立 WebSocket 连接
|
|
w := wshandle.New()
|
|
w.Interrupt = make(chan os.Signal, 1)
|
|
signal.Notify(w.Interrupt, os.Interrupt)
|
|
defer func() {
|
|
w.Conn.Close()
|
|
}()
|
|
ft.TracerouteMethod = trace.TCPTrace
|
|
ft.testCM()
|
|
ft.testEDU()
|
|
}
|