I'm not sure I fully understand how web3 interacts with the ethereum blockchain. When testing things out, I just use
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
And that allows me to access the test network locally. If I were to deploy this code on a website, what would I set this variable to, and how does that work? And what if that user is not running a local node and interacts with the blockchain through Metamask?