typicode / hotel

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

.localhost domains isn't working in chrome browser #272

Open rizalibnu opened 6 years ago

rizalibnu commented 6 years ago

I've setup local (.localhost) domains in System configuration and Browser configuration that following this rule https://github.com/typicode/hotel/blob/master/docs/README.md. Then, I've restart hotel and reload network and browser configuration.

when i try to run http://hotel.localhost/ in chrome, the browser response is

"This page isn’t working hotel.localhost didn’t send any data. ERR_EMPTY_RESPONSE" screenshot at jan 30 12-04-04

However, when i try to run http://hotel.localhost/ in safari, hotel is working correctly screenshot at jan 30 12-05-58

Also when i run http://localhost:2000/ hotel is working correctly both chrome and safari.

Chrome Version 63.0.3239.132 (Official Build) (64-bit) Safari Version 11.0.1 (13604.3.5) MAC OS High Sierra Version 10.13.1

bastianwegge commented 6 years ago

@rizalibnu here is a list of steps which you can follow:

  1. go into network settings -> advanced -> deactivate any proxy configuration
  2. close the network settings -> osx will ask "do you want to activate the changes" -> click activate
  3. go into your terminal
  4. stop hotel hotel stop
  5. remove the .hotel folder from your home-directory
  6. run npm r -g hotel (this will remove hotel from your global nodejs bins)

Once that all is done, you can be sure you have a clean system you can start over with. Follow the instructions below to setup hotel correctly.

  1. install hotel npm i -g hotel (installs hotel globally into your nodejs bin folder)
  2. start hotel hotel start (this will also generate the .hotel folder)
  3. now into your network settings -> advanced -> activate autom. proxy configuration
  4. enter http://localhost:2000/proxy.pac in the automatic proxy settings
  5. IMPORTANT: you need to click on ok and close the network settings. If you're trying to close the network settings they will ask you if you want to use the settings right now, click "activate" or "use"
  6. open chrome, go to hotel.localhost -> have fun

Contact me if you need any further assistance 👍

rizalibnu commented 6 years ago

@bastianwegge sorry for delay response. I've follow your instructions. still not working on chrome.

trejo08 commented 5 years ago

@rizalibnu have you solved this issue, I'm having the same problem in chrome with the same configurations and I have tried what @bastianwegge describes above and still not working for me.

I you have solved the issue I will thank you to give me directions to fix it.

ppciesiolkiewicz commented 5 years ago

I had the same issue with chromium - disabling holaVPN solved the issue Try: chrome --incognito --proxy-pac-url=http://localhost:2000/proxy.pac

JosephusPaye commented 5 years ago

It turns out that Chrome actually resolves *.localhost URLs to the local loopback address (127.0.0.1), and by default tries to request port 80, for http://.

See https://oliverlundquist.com/2018/02/26/chrome-does-not-resolve-localhost-tld.html. Seems like they're already implementing this proposal.

To get this to work with hotel when your tld is localhost, change the port to 80 in your hotel conf.json file.

rtablada commented 5 years ago

For mac users or other users that already have services listening on port 80 the solution I found was to change the TLD to hoteldev or something similar.

It is still a shoot out to find a TLD and chrome is still given SSL warnings but this seems to be the required workaround unless Chrome makes loopback routing either optional or renable it so that it prefers proxy definitions over loopback.

ArjunAce commented 3 years ago

I too had the same issue. Turns out my VPN client was interfering with hotel. Disabling the VPN client did the trick.

sugatoray commented 1 year ago

A fresh install with npm i -g hotel followed by hotel start says that http://localhost:2000 is up and running. But when I tried with Chrome/Edge/Safari, none worked.

So, it is not working for me (on Mackbook Pro M1). :fire:

hotel_start_error