Add proxy support for ICMP echo request
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-tun"
|
||||
"github.com/sagernet/sing/common/logger"
|
||||
N "github.com/sagernet/sing/common/network"
|
||||
@@ -17,6 +18,8 @@ type Device interface {
|
||||
N.Dialer
|
||||
Start() error
|
||||
SetDevice(device *device.Device)
|
||||
Inet4Address() netip.Addr
|
||||
Inet6Address() netip.Addr
|
||||
}
|
||||
|
||||
type DeviceOptions struct {
|
||||
@@ -35,9 +38,14 @@ type DeviceOptions struct {
|
||||
func NewDevice(options DeviceOptions) (Device, error) {
|
||||
if !options.System {
|
||||
return newStackDevice(options)
|
||||
} else if options.Handler == nil {
|
||||
} else if !tun.WithGVisor {
|
||||
return newSystemDevice(options)
|
||||
} else {
|
||||
return newSystemStackDevice(options)
|
||||
}
|
||||
}
|
||||
|
||||
type NatDevice interface {
|
||||
Device
|
||||
CreateDestination(metadata adapter.InboundContext, routeContext tun.DirectRouteContext, timeout time.Duration) (tun.DirectRouteDestination, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user