Closed evandam closed 3 years ago
This is not currently possible because currently routes are matched based on the host, and no wildcards are currently supported. It might be feasible to come up with a custom lookup function just for tcp dynamic, but I'm not sure there is a general enough use case to support it. Also, since with tcp fabio has no idea which dns name may have been used to connect there really isn't a clean way to match it on hostname either. With http or https we have other ways of determining that, but not with TCP.
How are you spinning up your environment?
So after digging in it's not a terribly difficult change to make (~ 4 lines), but I'm not really sure how generally useful this is. The change involved doing a lookup on the existing full local address with port, and then falling back to a route based on a target name which just used the local port that was connected to. I'll have to think this over, I may put together a small PR to get some eyes on it. I don't personally use the tcp dynamic feature.
I'm using tcp-dynamic proxy with
proxy.addr = :9999,0.0.0.0:0;proto=tcp-dynamic;refresh=5s
but wondering if there's a way to use routes without hardcoding an IP address if I understand correctly?For example, I have a service with the following tags:
The routes get added successfully, but they all result in "No route found" logs.
Is it possible to be able to resolve a hostname instead of use an IP address, or route based on port-only instead of ip:port?
Thanks in advance!