Update UoT protocol

This commit is contained in:
世界 2023-03-17 12:24:29 +08:00
parent a3a5185b15
commit 43f31b40ba
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
16 changed files with 186 additions and 118 deletions

View file

@ -589,12 +589,12 @@ func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata ad
}
metadata.Domain = metadata.Destination.Fqdn
metadata.Destination = request.Destination
return r.RoutePacketConnection(ctx, uot.NewConn(conn, request.IsConnect, metadata.Destination), metadata)
return r.RoutePacketConnection(ctx, uot.NewConn(conn, *request), metadata)
case uot.LegacyMagicAddress:
r.logger.InfoContext(ctx, "inbound legacy UoT connection")
metadata.Domain = metadata.Destination.Fqdn
metadata.Destination = M.Socksaddr{Addr: netip.IPv4Unspecified()}
return r.RoutePacketConnection(ctx, uot.NewConn(conn, false, metadata.Destination), metadata)
return r.RoutePacketConnection(ctx, uot.NewConn(conn, uot.Request{}), metadata)
}
if metadata.InboundOptions.SniffEnabled {
buffer := buf.NewPacket()