How do I get web3 currentProvider
HTTP URL? I'm using web3 1.0.0-beta.34
. I tried many functions and already looked at the docs - but still couldn't find the right way to get the URL of the current HTTP RPC node.
The pseudocode that I'm looking for:
if (is_using_http_rpc_fn) {
return currentProvider.url;
}
What functions to call for is_using_http_rpc_fn
and currentProvider.url
in above pseudocode?
ropsten
usingMetaMask
, MetaMask will connect to a URL likehttps://ropsten.infura.io/TOKEN
, whereTOKEN
is unique for the MetaMask application. If you could read out the URL, you'd get the private token, which is why I think that there are security reasons for why this it not possible. What you can do is callweb3.version.getNetwork(result => console.log(result))
to see the Network version