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

Not working in VirtualBox #127

Closed
JWo1F opened this issue Jul 23, 2016 · 6 comments
Closed

Not working in VirtualBox #127

JWo1F opened this issue Jul 23, 2016 · 6 comments

Comments

@JWo1F
Copy link

JWo1F commented Jul 23, 2016

When I try to open localhost:3000 (on host machine) I see "ERR_CONNECTION_RESET" or "ERR_CONNECTION_ABORTED".

How to reproduce:

  1. Install virtualbox (5.0.26)
  2. Install ubuntu 16.04
  3. Configure port-forwarding screenshot
  4. Install node (6.3.1) and npm (3.10.3)
  5. Install create-react-app and run create-react-app my-app
  6. Start it.
  7. Open http://localhost:3000 at host machine.

P.S: when I use "curl localhost:3000" on a guest machine all is okay. It's very strange.

@mxstbr mxstbr changed the title Not working at virtualbox (with port-forwarding) Not working in VirtualBox Jul 23, 2016
@mxstbr
Copy link
Contributor

mxstbr commented Jul 23, 2016

Is this something we can fix from our side?

@JWo1F
Copy link
Author

JWo1F commented Jul 23, 2016

@mxstbr Yes, it was a typo (I fixed it).

I don't know, but if I create a file like this:

var http = require("http");

http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(3000);

then start it and all is okay.


UPDATE: I think the problem is here: https://github.com/facebookincubator/create-react-app/blob/master/scripts/start.js#L150

When I remove 'localhost' all is okay.

@mxstbr
Copy link
Contributor

mxstbr commented Jul 23, 2016

Awesome, that's already very helpful @JWo1F!

WebpackDevServer uses http under the hood. Digging into https documentation this what it says about the hostname:

If the hostname is omitted, the server will accept connections on any IPv6 address (::) when IPv6 is available, or any IPv4 address (0.0.0.0) otherwise.

Which (I think) means that it's safe to remove that 'locahost' by default! Would you mind submitting a PR for that?

@JWo1F
Copy link
Author

JWo1F commented Jul 23, 2016

@mxstbr okay, please wait for PR :)

@JWo1F JWo1F mentioned this issue Jul 23, 2016
gaearon pushed a commit that referenced this issue Jul 23, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

Thanks!

@gaearon gaearon closed this as completed Jul 23, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

This should be fixed in 0.2.0 alpha. Can I ask you to try it and confirm? Here's how: #190

kalekseev pushed a commit to kalekseev/create-react-app that referenced this issue Sep 11, 2017
Remove unneeded React.Component type parameters
@lock lock bot locked and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants