Skip to content

Specify localhost as default host#203

Closed
leo wants to merge 3 commits intoember-fastboot:masterfrom
leo:master
Closed

Specify localhost as default host#203
leo wants to merge 3 commits intoember-fastboot:masterfrom
leo:master

Conversation

@leo
Copy link

@leo leo commented May 29, 2016

IMHO, "localhost" or "127.0.0.1" should be the default address that gets used when serving an ember app using FastBoot (instead of "::", which allows connections on any IPv6/IPv4 address by default).

Devs will still be able to specify a different host (or "::" for all) using --host.

BEFORE

Ember FastBoot running at http://[::]:3000

AFTER

Ember FastBoot running at http://127.0.0.1:3000

By the way, I've also considered simply adding an if-statement to the method that logs the message which replaces the host with "localhost" if the original value is "::". But in my opinion, that's not a good solution because "::" allows connections over all addresses, not just the localhost one.

A nice side-effect of this change is that the user will be able to click the address within the command line to open it in the browser using doubleclick + cmd.

Besides of that, it might also be a little more secure because the app will only be available on the exact address shown in the logged message.

{ name: 'environment', type: String, default: 'development', aliases: ['e',{'dev' : 'development'}, {'prod' : 'production'}] },
{ name: 'serve-assets', type: Boolean, default: false },
{ name: 'host', type: String, default: '::' },
{ name: 'host', type: String, default: 'localhost' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have this be ::1 so that it is still IPv6

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@leo
Copy link
Author

leo commented Jul 18, 2016

@danmcclain Looks like the commit broke the tests...?

@danmcclain
Copy link
Member

Looks like it will no longer support IPv4 127.0.0.1?

@leo
Copy link
Author

leo commented Jul 19, 2016

@danmcclain Replaced all localhosts and 127.0.0.1s with ::1, still doesn't seem to work. Any ideas on how to fix it?

@leo leo closed this Jul 23, 2016
xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this pull request Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants