jeredfloyd commented on PR #12338:
URL: https://github.com/apache/trafficserver/pull/12338#issuecomment-3212903885

   Copying my message to ts-dev here:
   
   I think something like the ACL Filters functionality is the right way to do 
what you want -- there is already "@in_ip" to select mappings based on the IP 
address on which the request was received.  Based on that, I would propose 
adding a parameter "@in_proto" that can take values "unix", "http", "http2", 
etc.  You can then create different mapping rules that are selected based on 
incoming protocol without modification to the target schema.
   
   Digging in a bit more to my thought process that led to this, I think there 
are two separate matters to consider here.
   
   The first is HTTP over sockets.  This isn't really HTTP(/[12]) if it's not 
over TCP, nor HTTP/3 if it's not over QUIC, is it?  The addressing schema for 
unix sockets is different, because in the general sense of trying to address an 
origin over a socket we're referring to a socket path rather than a hostname or 
IP address.  From ATS' perspective (as a reverse proxy, at least) the only 
things that matter are the Host header and the request target, but it's worth 
considering how a theoretical client would be addressing HTTP-over-socket.  It 
looks like WHATWG had some inconclusive discussion on this back in 2021, and 
it's worth reviewing that issue first: https://github.com/whatwg/url/issues/577
   
   More importantly, though, modifying the target schema for translating the 
map target based on how it arrived to ATS feels like an abstraction violation.  
There isn't how we currently remap differently based on received interface, or 
IP address ("@in_ip" ACL Filters), and we don't support this based on protocol 
(HTTP/1 vs 2 vs 3).  (The closest is map_with_recv_port, which is minimally 
documented and I'm not entirely certain what it does.)  This says to me that 
mis-using the schema part of the map target is not the right way to solve your 
problem.
   
   Therefore, I think an "@in_proto" extension for the ACL Filter mechanism is 
most parallel to the existing map language.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to