Clearly, this is no way to run a production service, but sometimes it's useful during development to run some services off-site where you have more opportunities to control and monitor application behavior. In my case, I simply did not have enough resources on my VPS to host my database, but I wanted to test things before upgrading. There was just one tiny snag: my home server is behind a NAT that I don't have any control over, and my VPS does not support IPv6 for NAT traversal purposes. What now?
The problem boils down to this: my database runs at
home:5984, I want it to be available at
vps, but
home is behind a NAT. The most notable solutions are:
- use a VPN
- use a SSH tunnel
SSH is easiest for mapping a single service, and I'd encourage you to look into reverse-tunneling if it fits your use case. A single command from
home does the trick for me:
ssh inportb@vps -R5984:localhost:5984
Also, here's the requisite screenshot as I index all my data...
Incidentally, the reason I can't use a VPN is the same reason I couldn't use IPv6: no tun/tap support in my VPS. There is clearly a performance issue preventing this from being a production-quality solution: the 3Mbps pipe between the two servers really can't compete against a local/loopback connection.