feat: handle local conn with gvisor (#665)

* feat: handle local conn with gvisor

* feat: remove udp route map

* feat: optimize code

* feat: length

* feat: works

* feat: should works

* feat: optimize code

* feat: optimize code

* feat: gudp not set remark

* feat: ut

* feat: set to default value 0

* feat: send reset to gvisor tcp forward request if error

* feat: not need to create firewall rule on windows

* feat: typo
This commit is contained in:
naison
2025-07-05 21:43:44 +08:00
committed by GitHub
parent 62725d8011
commit 211c9309b2
23 changed files with 655 additions and 468 deletions

View File

@@ -859,19 +859,19 @@ func Init(t *testing.T) {
t.Fatal(err)
}
go startupHttpServer(t, "9080", local)
go startupHttpServer(t, "8080", local8080)
go startupHttpServer(t, "localhost:9080", local)
go startupHttpServer(t, "localhost:8080", local8080)
}
func startupHttpServer(t *testing.T, port, str string) {
func startupHttpServer(t *testing.T, addr, str string) {
var health = func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(str))
}
mux := http.NewServeMux()
mux.HandleFunc("/", health)
mux.HandleFunc("/health", health)
t.Logf("Start listening http port %s ...", port)
err := http.ListenAndServe(":"+port, mux)
t.Logf("Start listening http addr %s ...", addr)
err := http.ListenAndServe(addr, mux)
if err != nil {
t.Fatal(err)
}