localhost unexpectedly closed the connection

2.7k views Asked by At

I'm creating a new Angular 6 project using 'ng new appname'. However when I run the command 'ng serve -o' it builds the project as it should opens the browser. However the error 'The device or resource (localhost) is not set up to accept connections on port "4200".' displays. I've tried searching on stackoverflow and google. However the only things that come up are typically for node or are of not help.

What I gathered is it is probably a setting somewhere on my computer that needs to be change or there is a problem with malware, antivirus protection. I've restarted my computer created new angular projects to see if the creation was the issue.

It works when I have an ASP.NET/Angular project mix but not pure Angular. I'm also thinking there could be an issue with SSL. However I haven't been able to find a solution to it.

Edit: Another thing is, is that projects that use to work in Angular are now having the same issue.

The url for localhost is https://localhost:4200/ when I open Mozilla and make it http i can view the page. However it doesn't work on Chrome if I make it http and press enter it changes back to https.

0

There are 0 answers