typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.97k stars 426 forks source link

ERR_CONNECTION_REFUSED #367

Open iamludal opened 3 years ago

iamludal commented 3 years ago

Hello 👋,

I know that's a duplicate issue, but I've searched for everything concerning : hotel.localhost, hotel.dev, ERR_CONNECTION_REFUSED, and couldn't find any solution.

http://localhost:2000 works fine, but ❌ http://hotel.localhost doesn't.

I've tried to use another browser, Firefox ("Unable to connect"), use https over http, set my proxy settings to 'Automatic' and with http://localhost:2000/proxy.pac as configuration url, but nothing seems to works.

Here's the content of ~/.hotel/daemon.log:

20:00:41 - Watching /home/ludal/.hotel/servers
20:00:41 - /home/ludal/.hotel/servers/aikido-roncq.json added
20:00:41 - Add server aikido-roncq
create /home/ludal/.hotel/daemon.pid 55298
20:00:41 - Reading self-signed certificate in ~/.hotel
Exiting
Stop daemon
Remove pid file
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::2001
    at Server.setupListenHandle [as _listen2] (net.js:1313:16)
    at listenInCluster (net.js:1361:12)
    at Server.listen (net.js:1447:7)
    at ProxyServer.listen (/home/ludal/.nvm/versions/node/v12.18.0/lib/node_modules/hotel/node_modules/http-proxy/lib/http-proxy/index.js:136:16)
    at Object.<anonymous> (/home/ludal/.nvm/versions/node/v12.18.0/lib/node_modules/hotel/lib/daemon/index.js:46:7)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1340:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 2001
}

The content seems to be the same as #300, and #323 .

If anyone has an idea, please don't hesitate.

Thanks in advance. 😊

Specificiations

Ubuntu 20.04.1 LTS Google Chrome 86.0.4240.111 Mozilla Firefox 82.0 Hotel 0.8.7

iamludal commented 3 years ago

Edit 1

After running sudo lsof -i:2001, I found that the port 2001 (which caused an error, logged in daemon.log) was used by a node process (which I thought was deriving from hotel).

I killed the process using sudo kill, and tried to restart hotel (hotel stop && hotel start), and now here's how my daemon.log look like:

20:42:29 - Watching /home/ludal/.hotel/servers
20:42:29 - /home/ludal/.hotel/servers/aikido-roncq.json added
20:42:29 - Add server aikido-roncq
create /home/ludal/.hotel/daemon.pid 58932
20:42:29 - Reading self-signed certificate in ~/.hotel
20:42:29 - Server listening on port 127.0.0.1:2000
20:42:29 - /home/ludal/.hotel/servers/aikido-roncq.json added
20:42:29 - Add server aikido-roncq
20:43:13 - Resolve aikido-roncq
20:43:13 - aikido-roncq has started

However, I'm still unable to reach http://hotel.localhost (on both Chrome and Firefox)

iamludal commented 3 years ago

Edit 2

Setting :

{
  "tld": "local"
}

in .hotel/conf.json seemed to fix my problem. I can now access to hotel.local (but still not hotel.localhost).