Connecting to localhost:8080 using Google Chrome

20.2k views Asked by At

I'm currently developing a card game using node.js and gulp, and suddendly Chrome stopped to find localhost:8080. After some research, some people had the same problem and solved it by disabling "Built-in Asynchronous DNS" in chrome://flags, however, this flag seems not to exist anymore.

When a friend of mine launch the same code also with gulp and with the same version of Chrome, it works. Any idea ?

4

There are 4 answers

0
Viliami On BEST ANSWER

In the chrome url bar type "chrome://net-internals/#hsts" and delete the localhost domain, by typing "localhost" into the Delete Domain text box.

Type "localhost" into the Query Domain text box and if it says "Not found" than it was successful.

0
shan1024 On

I am not very experienced in web developing and this might not be a very good answer. I am new to stackoverflow, so I cannot add any comments. That is why I post this as an answer to share my experiences.

One possible scenario is that you are already running an application that uses port 8080. As an example, if I use WAMP server to host a web page in port 8080 and Node.js to run a REST API in port 8080, one application might run on localhost:8080 and other on 127.0.0.1:8080 even though they are the same and the webpage will not be able to use the REST API because the hosts do not match. In fact, this happened to me while ago and I could not find a solution for it. So I had to serve the web page through Node.js. Hope this answer is helpful.

0
Eddy Vinck On

I was running into this issue as well. None of the other answers worked for me.

What did work for me was simply changing the port of my localhost to 3000.

Using Webpack:

// webpack.config.js 

module.exports = {
  ...
  devServer: {
    port: 3000,
  },
  ...
};
0
Yousuf Azhar On

You should see the /etc/hosts file to find out the DNS pointing and secondly use 127.0.0.1 should point to your hostname or default server for the local host to work.

The DNS can't find anything running your localhost:8080, because either something else is running there or you simply didn't tell your localhost i.e. 127.0.0.1 to point towards your server.