Easy Workaround For Web3-js httprequest Security Restrictions

taoteh1221taoteh1221 Member Posts: 10
FYI, if anybody is getting stuck on httprequest Security Restrictions in web3-js, the solution on a PHP-based server is very easy: use a simple proxy script to route the json data through the server domain or ip address at mywebsite.com/proxy/ or your.ip.address.here/proxy/ (add http server port number if its not the standard port 80). Here is a super-simple script that does exactly that, have tested it and it works great:

https://www.dragonfrugal.com/transfer/php-proxy.zip

Then merely find / replace all instances of this in web3-js:

localhost:8545

With this:

your.ip.address.here/proxy/

Comments

Sign In or Register to comment.