devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Consider binding to localhost instead of 127.0.0.1

Open withinboredom opened this issue 3 years ago • 4 comments

https://github.com/loft-sh/devspace/blob/596b007df4b4d7cbaafb188ee48295d68ebcf599/pkg/devspace/server/port_forward.go#L94

With the prevalence of ipv6-only networks growing (and allowing this to work in environments like WSL), can you please consider binding to localhost instead of a hardcoded ipv4 address?

withinboredom avatar Nov 08 '22 00:11 withinboredom

@withinboredom thanks for creating this issue! We have an option to override this with:

dev:
  my-dev:
     ports:
    - port: 8080
      bindAddress: "localhost"

FabianKramm avatar Nov 09 '22 14:11 FabianKramm

Hei, @withinboredom.

Does the suggested workaround work for you, for now?

alexandradragodan avatar Nov 10 '22 10:11 alexandradragodan

Yes, the workaround works for me. What is the behavior of this option for reverse port forwarding? It doesn't seem to work in my network (binding to localhost, ::1, or another IP in my network doesn't seem to do anything).

withinboredom avatar Nov 19 '22 17:11 withinboredom

@withinboredom not sure if this setting makes sense for reverse port forwarding as the listening happens within the container and then a connection to the localhost is made.

FabianKramm avatar Nov 28 '22 17:11 FabianKramm