metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.75k stars 101 forks source link

Capability to modify the local listen address for mirrord #2319

Closed danielloader closed 5 months ago

danielloader commented 6 months ago

Feature request born out of the issue comment found here: https://github.com/metalbear-co/mirrord/issues/1658#issuecomment-2016755958

I'd like to be able to bind mirrord to 0.0.0.0 so I can expose a mirrord tunnelled application from inside a local container.

This would permit containers in the same network namespace or the host OS applications if the container is port mapped, access to the kubernetes internal network via proxy services, e.g. tinyproxy, microsocks, squid etc.

I'd like to configure this via CLI arguments in addition to the mirrord configuration file.

Where to begin?

Please refer to the CONTRIBUTING.md file

aviramha commented 6 months ago

I tried to remember why we did this change (we always bind localhost instead of real address) and the case is when user tries to bind remote ip, and then it fails when listening locally. I think the change should be to check if localhost or 0.0.0.0 and in that case listen locally on same, else fallback to localhost

danielloader commented 6 months ago

I'm happy if the default current behaviour is retained and a more explicit flag is needed to get this potentially more dangerous behaviour, rather than some auto-magic logic to ascertain uncertain intent. Though if you think it's a bug that the wrapped binary binds to 0.0.0.0 and mirrord doesn't also do the same, I'm happy to treat it as such.