{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4775","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4775/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4775/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4775/events","html_url":"https://github.com/ember-cli/ember-cli/issues/4775","id":103951520,"number":4775,"title":"ember serve --host's default disables IPv6","user":{"login":"buschtoens","id":834636,"avatar_url":"https://avatars.githubusercontent.com/u/834636?v=3","gravatar_id":"","url":"https://api.github.com/users/buschtoens","html_url":"https://github.com/buschtoens","followers_url":"https://api.github.com/users/buschtoens/followers","following_url":"https://api.github.com/users/buschtoens/following{/other_user}","gists_url":"https://api.github.com/users/buschtoens/gists{/gist_id}","starred_url":"https://api.github.com/users/buschtoens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buschtoens/subscriptions","organizations_url":"https://api.github.com/users/buschtoens/orgs","repos_url":"https://api.github.com/users/buschtoens/repos","events_url":"https://api.github.com/users/buschtoens/events{/privacy}","received_events_url":"https://api.github.com/users/buschtoens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-30T21:20:06Z","updated_at":"2015-08-31T00:30:50Z","closed_at":null,"body":"When `ember serve` is run without the `--host` option, it uses the default host, which is [defined as `\"0.0.0.0\"`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/commands/serve.js#L21).\r\n\r\nThis works fine for the old IPv4 stack. However, by setting the host to `\"0.0.0.0\"` and not passing a `null` / `undefined` value, Node.js (implicitly?) only binds to all IPv4 interfaces.\r\n\r\nTo make ember-cli listen to the IPv6 devices instead, I currently have to pass `--host ::`. However, this simultaneously disables the IPv4 stack.\r\n\r\nI see multiple solutions to this problem and would make a PR, if we can agree on one.\r\n\r\n1. Set the default value of `host` to `null` in [`commands/serve.js`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/commands/serve.js#L21) and teach [`express-server.js#displayHost`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/tasks/server/express-server.js#L37-L39) and [`livereload-server.js#displayHost`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/tasks/server/livereload-server.js#L70-L72) about it.\r\n\r\n2. Implicitly discard `host` if it is `\"0.0.0.0\"` and pass `null` instead at [`express-server.js#startHttpServer`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/tasks/server/express-server.js#L204) and [`livereload-server.js#start`](https://github.com/ember-cli/ember-cli/blob/v1.13.8/lib/tasks/server/livereload-server.js#L44).\r\n\r\n3. Set the default value of `host` to a magic keyword like `INADDR_ANY` or `all` and implement the changes accordingly.\r\n\r\nPersonally, I'd prefer solution 1. Solution 3 just feels very clunky and I don't like how solution 2 hides what's really happening; if I read that `\"0.0.0.0\"` is the default, I'd expect that this really is the value that is passed to the `.listen()` call.\r\n\r\nSolution 1 is the cleanest imho. It might only look a bit weird in `ember help serve`, as I don't know how `nopt` handles `null` values."},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/136222298","html_url":"https://github.com/ember-cli/ember-cli/issues/4775#issuecomment-136222298","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4775","id":136222298,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T00:30:50Z","updated_at":"2015-08-31T00:30:50Z","body":"solution 1. also appeals to me."}}