EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

Secure HTTP Endpoint #42

Closed jcalfee closed 6 years ago

jcalfee commented 6 years ago

The following dawn2 Testnet endpoints are available:

Up until now we had only http .. This causes a problem in applications hosted over https because web pages should not mix http and https traffic. In this case requests to the eos node were blocked completely.

I propose that if an httpEndpoint is not provided to Eos.Testnet({..}) and the library is running in a browser, the current url protocol be tested and either the http or https url above be automatically selected. If eosjs is running elsewhere, https should be used.

This change needs to be tested from node and the browser.

jcalfee commented 6 years ago

Work-around, provide the https URL in your endpoint: Eos.Testnet({httpEndpoint: 'https://t1readonly.eos.io'})

jcalfee commented 6 years ago

publish npm version eosjs@7.1.4