Chrome insists on accessing localhost through HTTPS, any way to change that? - google-chrome

I have a local webdev setup using AMPPS on OSX. I've done most of my work on Firefox and that's been working fine, but trying it on Chrome today gave me a whole bunch of Failed to load resource: net::ERR_CONNECTION_CLOSED errors everywhere. Looking further it seems like Chrome wants to access every resource through HTTPS. Firefox doesn't have this issue, it access all resources through HTTP and the site displays fine.
Is there any way to force Chrome to access localhost through regular HTTP? I've tried every solution I could find - including going to chrome://net-internals/#hsts and deleting localhost (localhost doesn't show up in the domain query so there's nothing to delete) - and nothing seems to work.

Related

Chrome wont open websocket (wss) from a domain to a subdomain

I have a domain x.com which is running a web application
There is an MQTT server running on subdomain mqtt.x.com, with websockets / wss all set up,
Using Chrome:
If I head to https://x.com, and run this in console:
let ws = new WebSocket('wss://mqtt.x.com')
I get the following error:
WebSocket connection to 'wss://mqtt.x.com/' failed:
If I go to a completeley different domain (such as stackoverflow.com) and run the command, it works fine.
In firefox/opera/edge, no errors, and it all works fine.
Is there any way to get a more verbose error from chrome?
Or any other idea to resolve this?
Edit
Clearing cookies seemed to solve this. still not really sure why.
Clearing Cookies seemed to be the answer.

Cookies are erased when opening dev tools on localhost

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

while accessing a site hosted in the staging environment getting access forbidden error

When i try to open a particular URL in the staging environment am getting 403 Access Forbidden in Chrome (tried IE, Firefox as well ). The same site is opening to the person sitting next to me.
both are connected to same network, tried clearing cookies , tried opening from different browsers .
Anything that i should be looking in particular, in this scenario ?

Adding 127.0.0.1 to hosts file to redirect locally has error. Says my site “refused to connect.”

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.

how html5 apache works first time

I have created one HTML5 web app which works in offline mode.I load it first time form server and then when server is off it works perfectly.Webapp url is http://localhost/index.html
Now , if I try to load that webapp first time on any new machine then how can it resolve the localhost url.I have all the resources bundled with webapp.
In this case server is off and browser is not able to locate url http://localhost/index.html
Any idea if webapp can work in offline mode , even if its not connected to server ever.
What you are doing and expecting seems to make sense. It would be smart to check the console in the Chrome Developer tools. Something along the lines of the following should be shown:
You might be serving the manifest file with the wrong content type (should be text/cache-manifest) or the fact that you're working on localhost might somehow interfere (dunno).