mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-03 20:27:31 +00:00
19 lines
377 B
Go
19 lines
377 B
Go
package trusttunnel
|
|
|
|
import (
|
|
"github.com/metacubex/mihomo/transport/gun"
|
|
|
|
"github.com/metacubex/http"
|
|
"github.com/metacubex/quic-go/http3"
|
|
)
|
|
|
|
func forceCloseAllConnections(roundTripper RoundTripper) {
|
|
roundTripper.CloseIdleConnections()
|
|
switch tr := roundTripper.(type) {
|
|
case *http.Http2Transport:
|
|
gun.CloseTransport(tr)
|
|
case *http3.Transport:
|
|
_ = tr.Close()
|
|
}
|
|
}
|