Open markpash opened 2 years ago
This would be very useful for me!
I don't see a need to change the binding structure, because nothing really changes. Sidecar still binds ONE port to ONE port
We simply need to check if the destination is on the tailscale network. Or use a prefix like ts://db:3306
If it is (or there is a prefix), it's a connection from anything outside to a machine on the network, else the behavior stays as it is now
I forgot to tell you that in the end I came up with this: https://github.com/4310V343k/tailscale-sidecar/commit/4945b1a7e77e1970531650becae075d18e953506 This is my first time using go so i just made a working poc version. The functions are nearly the same so there is a clear way to shorten up the code, but it works!
A little while ago, the tsnet package incorporated the ability to Dial into the tailnet. This unlocks a whole new set of features to be implemented.
One of these features is the ability to listen on non-tailnet interfaces/addresses and proxy all accepted connections to an address:port on the tailnet.
I'm not sure how I would implement this in our bindings structure, so I'm thinking I'll have to redo the structure of the configuration file.