The best way to accomplish this is to create a VPN tunnel between the two locations. This will create an encrypted tunnel that will allow you to pass data between the two locations safely. To clarify, I am not talking about paying for, or using a "free" VPN service that are advertised on the internet. What I am suggesting is a self-hosted solution that you create. Depending on your network gear (ie your router), it's likely that you can host this directly on the router.
The main thing to keep in mind is that you need fast enough internet connections to make this work. The "upload" speed of your internet at "location B" is going to be critical and is likely the limiting factor unless you have some decent internet speeds.