UNSAFE PORT Error: [ERR_UNSAFE_PORT] in ElectronJs with React when making a get request to a service with port 6000 (not secure)

Viewed 27

I have an application in Electron and React, in the application there is an entry where I put an ID that makes a request to a service that runs on port 6000 (which is a non-secure port)

PD: I did not do the service

[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `babel-node src/index.js`
Server on port 6000

When I run the app with electron and try to make the request with the ID, I get the following error:

Failed to load resource: net::ERR_UNSAFE_PORT    localhost:6000/...

I have, so to speak, a version of the app that runs with electron and the other normal in the browser where it also gave me the same error but I solved it with the following:

https://i.stack.imgur.com/UKVrb.png

Adding that to the Google Chrome properties prevented that error, but I don't know how to do it with electronJs or if there is any way to mimic it.

I don't know why the image appears only with the link and it is not shown, in Spanish StackOverflow it was shown.

0 Answers
Related