We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to extract and use basic auth username and password from RPC URL.
Replace:
engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(rpcUrl)))
with:
let username, password; let start = rpcUrl.indexOf("://"); if (start != -1) { start += 3; const end = rpcUrl.indexOf("@", start + 1); if (end != -1) { const credentials = rpcUrl.substring(start, end); let [u, p] = credentials.split(":"); username = u; password = p; } } if (typeof username === 'undefined' || typeof password === 'undefined') { engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(rpcUrl))) } else { engine.addProvider(new Web3Subprovider(new Web3.providers.HttpProvider(rpcUrl,0,username,password))) }
And minify :)
The text was updated successfully, but these errors were encountered:
allow credentials in http provider #9
33a6768
ac26da6
Merge pull request #10 from AlphaWallet/allow-credentials-in-http-pro…
fa7a750
…vider allow credentials in http provider #9
bitcoinwarrior1
Successfully merging a pull request may close this issue.
Add support to extract and use basic auth username and password from RPC URL.
Replace:
with:
And minify :)
The text was updated successfully, but these errors were encountered: