When running the application on the browser I saw this error in the console.
I have dockerized my application and using nginx proxy for https.
I know it is asking me to open the ports 53703, but I am not getting where to open the ports in aws or in docker run command? I am also using it through aws.
Mixed Content: The page at 'https://xuz.xyz.com/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://xuz.xyz.com:53703/'. This request has been blocked; this endpoint must be available over WSS.
Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
at Object.openConnection (https://xuz.xyz.com/__ion-dev-server/ion-dev.js?v=2.0.2:101:19)
at Object.start (https://xuz.xyz.com/__ion-dev-server/ion-dev.js?v=2.0.2:18:10)
at https://xuz.xyz.com/__ion-dev-server/ion-dev.js?v=2.0.2:465:16
Note: I know the shield icon, but don't want to allow the insecure scripts.
Related
I am using Expo SDK Version: 36 to generate a PWA.
curl http://$LOCAL_IP:19006/expo-service-worker.js: OK 200
curl http://localhost:19006/expo-service-worker.js: FAIL => Instead of serving expo-service-worker.js it serve the static asset index.html.
It cause the following error in the console:
Failed to register service-worker DOMException: Failed to register a ServiceWorker for scope ('http://localhost:19006/') with script ('http://localhost:19006/expo-service-worker.js'): The script has an unsupported MIME type ('text/html').
The file expo-service-worker.js is not served and this is problematic when you must implement web push notification because only localhost can work without it when site is not served with HTTPS.
Related issues:
https://github.com/expo/expo-cli/issues/2063
https://github.com/expo/expo-cli/issues/2468
How can I fix it?
I know this error is common when using local files, like C:// or files://, but the thing is, Im running my app on localhost, through http-server package.
mongoose.connect('mongodb://myuser:mypswd#ds225608.mlab.com:25608/todo-list-db')
I'm getting the error: "registerServiceWorker.js:71 Error during service worker registration: DOMException: Only secure origins are allowed (see: https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features)." This is on the console of a React JS web app.
I understand that to resolve this error I would need to setup HTTPS on my API server, the problem is that I am running this app on the local network and it is served through a local IP address. This web app also uses data that is only exposed locally so I can not host it externally and get an SSL cert for a domain.
From what I've read on StackOverflow I could create a self-signed certificate but this would show users an SSL error page on most browsers.
What would be the best option to resolve this issue?
I'm developing an AngularJS web app and I'm testing by running the app locally, e.g. it's not on a server. I keep running into the following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS header 'Access-Control-Allow-Origin' missing).1 (unknown)
My SO research tells me this is an error on the server side, but I have been successful getting data back from my iOS app running in the simulator and have used Postman with success.
Per suggestion, I'm running the app through http-server. Same issue.
I added a simple test case with the same results:
$http.get("http://www.yahoo.com")
.then(function (response) {
alert("Search Results: " + response);
}, function(error) {
alert("Could not get to Yahoo");
});
This is totally baffling.
Based on this comment:
I'm developing an AngularJS web app and I'm testing by running the app locally, e.g. it's not on a server
Then the reason this is not working is obvious: You cannot make asynchronous calls to servers in Javascript with most modern browsers by default if you are not running the javascript from a webserver (http:// instead of file:///). This is a security measure that is built into virtually all browsers. You could possibly get around this by launching the browser with certain flags; for example with Chrome you could run from the command line chrome --allow-file-access-from-files file:///[PATH_TO_FILE]
However it's recommended that you just run the javascript from a web server. This is extremely simple to do, you could use the node package http-server or Python's SimpleHTTPServer to serve the files up right from the directory they are in.
I am trying to host my webapp. I started with a python simpleserver, but had errors, and so with chrome and other browsers I wasn't able to send my files like a csv.
The error is XMLHttpRequest cannot load file:... Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
And Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load .
So I tried Apache Tomcat 7 as a server, however after starting Apache7 I am confused as to how I view my webapp. I tried putting my webapp into the apache bin and calling it with localhost:8080/dataAnalyticsProject/page.html but that produces a 404 error.
My files are located in C:\Users\apt\Downloads\apache-tomcat-7.0.63-windows-x64\apache-tomcat-7.0.63\webapps\dataAnalyticsProject. How do I start up this server so that I can view my webapp?
Thanks