Can it be done in node.js under a VM so to isolate the traffic and force it to use vpn etc.

Found it based on comments here:

https://github.com/webtorrent/webtorrent

I guess the VM part is just to use a unikernel then try to find a way to auto use vpn.