Add dns client

This commit is contained in:
世界
2022-07-06 23:11:48 +08:00
parent 651c4b539a
commit 8a761d7e3b
23 changed files with 582 additions and 145 deletions

View File

@@ -191,6 +191,14 @@ func (r *Router) Outbound(tag string) (adapter.Outbound, bool) {
return outbound, loaded
}
func (r *Router) DefaultOutbound(network string) adapter.Outbound {
if network == C.NetworkTCP {
return r.defaultOutboundForConnection
} else {
return r.defaultOutboundForPacketConnection
}
}
func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
if metadata.SniffEnabled {
_buffer := buf.StackNew()