mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-13 13:38:06 +08:00
33 lines
470 B
Go
33 lines
470 B
Go
package gun
|
|
|
|
import (
|
|
"golang.org/x/net/http2"
|
|
"net"
|
|
)
|
|
|
|
type TransportWrap struct {
|
|
*http2.Transport
|
|
netAddr
|
|
}
|
|
|
|
func (tw *TransportWrap) RemoteAddr() net.Addr {
|
|
return tw.remoteAddr
|
|
}
|
|
|
|
func (tw *TransportWrap) LocalAddr() net.Addr {
|
|
return tw.localAddr
|
|
}
|
|
|
|
type netAddr struct {
|
|
remoteAddr net.Addr
|
|
localAddr net.Addr
|
|
}
|
|
|
|
func (addr *netAddr) RemoteAddr() net.Addr {
|
|
return addr.remoteAddr
|
|
}
|
|
|
|
func (addr *netAddr) LocalAddr() net.Addr {
|
|
return addr.localAddr
|
|
}
|