I have used a method for years that has worked for me and limited any mysterious domain-based issues with cookies and such.
In my /etc/hosts file, I do the following for the local development version of www.mysite.com:
127.0.0.1 localhost local.mysite.com
When I visit http://local.mysite.com:3000, this has done exactly what you'd expect for years and years, and still works in Safari and Firefox. However, Chrome started stubbornly giving me an ERR_CONNECTION_REFUSED message a few months ago, and I can't make it work. If I visit http://localhost:3000, it works fine, but I avoid developing against localhost for various reaions. I have tried every possible thing I can find on the internet (clearing caches etc), and nothing has made the error go away.
Anyone have any idea what can be done here?
In the browser, please clear host cache and then try it out. To clear host cache, follow the steps below
Open up Chrome browser and enter " chrome://net-internals/#dns " in the address bar without quotes
Click on the button Clear host cache
Restart your browser and try again
You need to disable the dns prefetching and network condition predicting services on chrome.
As chrome is trying to look for local.mysite.com in actual dns servers and not finding the local ip address.
You can see the below steps -
Go to chrome://settings
Click on "Show advanced settings..."
Unmark the Predict network actions to improve page load performance
box.
Check if the DNS prefetching is really disabled by going to
chrome://dns.
You should see there something like DNS pre-resolution and TCP
pre-connection is disabled.
Related
I wanted to change DNS server on macOS 10.14.6 by going to System Preferences -> Network -> Advanced..., and adding 8.8.8.8 in the DNS tab. Since then, Chrome gives me a
DNS_PROBE_FINISHED_BAD_SECURE_CONFIG error.
First I returned to the previous DNS settings (putting 192.168.1.1 in place of 8.8.8.8). Since then I tried switching my router off/on. I cleared the Chrome DNS cache as explained in this answer. I cleared browsing data (history, cache, cookies) on Chrome. I stopped and restarted the mDNSResponder service.
From the terminal, both ping and curl work fine. Other browsers (Safari) work fine. Why do I see this error, and how do I solve it?
If you have checked all DNS settings but still got this error, you could take a look at the Chrome Secure DNS to see if this setting had switched on.
To turn Chrome Secure DNS on or off:
Open Chrome.
At the top right, tap More and then Settings.
Under “Privacy and security,” tap Security.
Turn Use Secure DNS on or off.
Anytime I have dev tools open on localhost my cookies are deleted and I am redirected to the login page on every page load which means I cannot use dev tools to debug or get insight into my site. I have localhost setup with a valid SSL cert (self-signed) and the site works normally until I open dev tools. How do I fix or disable this new "security" or setting in chrome?
After lots of issues and trying out many different things I came across this post/answer
When adding a Javascript library, Chrome complains about a missing source map, why?
Turns out that when I opened Dev Tools it would request a CSS map and the request was being sent to a different firewall causing my application to require me to re-authenticate every time this resource was requested. Turning off the CSS source map option fixed the issue
On Linux Debian 10 (Buster), I am using the http(s) client google-chrome-stable.
I was configuring (nginx) and testing (chrome) a reverse proxy and it got cached using a wrong domain.
I fixed the configuration but it still resolve to the wrong domain.
I have tried to go chrome://net-internals/#dns and click on Clear host cache but that didn't change anything.
I have tried to go chrome://net-internals/#sockets and click on Flush socket pools but that didn't change anything.
I am not working with FireFox, so FireFox can resolve correctly (so does curl).
After about 10 minutes, without restarting chrome. I did F5 (refresh) and it was loading the proper page. I haven't found a manual way to immediatly clear chrome cache.
I am doing devops and I haven't solved this issue for years.
Would love to know how to do one day :O
What happens if you open developer console F12 and then hold down on the refresh button and then select empty cache and hard reload?
Take a look at this gif for an example.
I answered this below for anyone that is interested
I'm on Windows 10 using Chrome, Firefox and MS Edge. I'm trying to do something for a class I'm taking and can't get it to work. All I want to do is add something like this to the hosts file:
127.0.0.1 mysite.dev
This is ALL to run on my local PC. I eventually need to have my site able to run on IIS, but this is the first step and I can't get past it. (I'm on my second day trying)
What I've done:
I did edits in notepad on a file on my desktop.
I renamed the original hosts file in the drivers/etc directory.
I copied my file into the drivers/etc directory.
I ran ipconfig -flushdns
I successfully pinged the new site with: ping mysite.dev
I cleared browsing history in all three browsers.
I reopened all three browsers.
All that failed to make any difference (and I rebooted as well) So I added this:
I ran ipconfig -flushdns
Then ipconfig -renew
Then ipconfig -registerdns
Then repeated steps 5->6 and all failed to make any difference. These are the errors per browser:
Chrome: This site can’t be reached mysite.dev refused to connect.
Firefox: Unable to connect Firefox can’t establish a connection to the server at www.mysite.dev.
MS Edge: Hmmm...can’t reach this page
I noticed that all three browsers changed http to https. Not sure if that mattered but I followed instructions to disable this re-direct for all three browsers and NONE of them actually stopped the redirect to https.
And I still can't the correct result, which should be the IIS default page. I can see the IIS default page with localhost, so IIS is running.
Help! Any ideas or directions at all would be very appreciated!
Got the answer from someone. Google owns the .dev domains and has restrictions on it so it HAS to be HTTPS, which requires certs etc, which is not in the scope of my class. I just changed it to mysite.local and BOOM!, there it was! Thanks.
I'm having a problem where Chrome & Firefox have both started bringing up a popup window saying authentication required when going to localhost (401 page).
If I am on the network I can put in my usual network username/password and it works fine, but if I'm offline (the very reason I'm using localhost) that authentication fails and I get sent to a 403 page.
This does not happen in IE and was not happening a few days ago, my network settings are set to ignore Proxy on localhost and auto detect settings is switched off.
Any ideas?
Problem is the permission of your site directory. If you put the folder under your home (~), then this problem will probably occurs. Try to give your home folder a wider permission. Especially read permission for Others.
sure, if you browse the localhost pure directory you need apache / server authentication
Check your server authentication credentials (user and pass) and this is normal!
while if you browse localhost/mysite you will need not an auth ;)
also be sure your localhost/myproject folder has 755 chmod permissions
finally check if in your localhost/myapp/ there is a .htpasswd file and post it here
I also encountered a similar problem and reinstalling chrome to older version, changing proxy setting didn't help.
I have started using other browsers, however i use the below workaround in case I need to work in chrome.
1.) Click on login without inserting any username and password .
2.) Click on (X) to close the window.
The window would disappear. However, it will reappear if you open any other site or window.