Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for adding 127.0.0.1 entries #91

Closed
crussell52 opened this issue Dec 18, 2015 · 3 comments
Closed

Option for adding 127.0.0.1 entries #91

crussell52 opened this issue Dec 18, 2015 · 3 comments
Assignees
Labels

Comments

@crussell52
Copy link

In some cases, it is preferable to connect to the vagrant machine using localhost and forwarded ports.

(One such case is when on a securely configured VPN which sucks up all LAN traffic.)

In these cases, it would be very convenient if there was an plugin option enabling localhost entries.

config.hostsupdater.localhost_entries = true

It may also make sense to add a similar flag to turn off private network IPs. That way, the following configuration would result in entries for only localhost.

config.vm.network "private_network", ip: "172.21.9.9"
config.vm.hostname = "www.example.com"

config.hostsupdater.localhost_entries = true
config.hostupdate.private_network_entries = false

This would be more convenient than adding the "skip" option to the private network, especially in cases where there are multiple IPs configured.

@cgsmith
Copy link
Collaborator

cgsmith commented Jan 15, 2016

@crussell52 I worry about the localhost getting polluted. Is this a worry for anyone else?

What about using vagrant's forwarded ports?

@cgsmith cgsmith self-assigned this Jan 15, 2016
@crussell52
Copy link
Author

One of the work-arounds I had for the VPN-scenario is to use localhost:8000 in my browser for reaching the application. However, I am working on a multi-tenant site where the subdomain is meaningful (part of the resolving usernames). This makes the ability to use subdomains paramount.

In reality, I would still be using port forwarding in conjunction with the hosts rewriting to reach the application via: someclient.mydomain.local:8000 where someclient.mydomain.local was mapped to localhost.

I'm wouldn't be over-concerned about localhost becoming polluted since hostsupdater does such a great job of cleaning up after itself. Only boxes that were running (and configured) would have registered localhost entries.

What I don't know is what the expected behavior would be if both private_network_entries was turned on and localhosts_entries was turned on. I guess it would be similar to cases where two private_network IPs are present?

@cgsmith
Copy link
Collaborator

cgsmith commented Mar 30, 2018

This is taken care of by default with the latest release with this PR #23

@cgsmith cgsmith closed this as completed Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants