QuantumMechanics / NEM-sdk

NEM Developer Kit for Node.js and the browser
MIT License
137 stars 82 forks source link

Failed to fetch #46

Open fsanano opened 6 years ago

fsanano commented 6 years ago

We add nem to our web app with this package. On localhost all works fine, but on the production to all request we get:

{
  code: -1,
  data: {
     message: "Failed to fetch"
     stack: "TypeError: Failed to fetch"
}

Tried use endpionts:

nem.model.objects.create('endpoint')(nem.model.nodes.defaultMainnet, nem.model.nodes.defaultPort)

nem.model.objects.create('endpoint')('https://bit.diamonds', 7890);

Safare return this error:

 An SSL error has occurred and a secure connection to the server cannot be made.

if interest application here

evias commented 6 years ago

This commit should be merged @QuantumMechanics as I think it improves the way endpoints can be used.

Regarding the HTTPS issue @fsanano, most of the NIS nodes are published on HTTP which means when you try SSL over this connection, it will argue badly. You can ask the community for a few HTTPS nodes, those are usually running HTTP NIS over 7891 (not 7890) and WSS over 7779 instead of 7778 ✌️

roccomuso commented 5 years ago

too bad http endpoint are still default in 2019. Especially considering that this lib could request to a server for account creation. With plain text privateKey as response.