This little nodejs app will forward HTTP connections to your local libvirt containers/guests.
The route table is constructed by simply concatenating the local guest name to the host name. e.g.
host: myserver.local
, guests: foo
& bar
, resulting routing table:
{
"foo.myserver.local": "foo",
"bar.myserver.local": "bar"
}
node server.js
Options:
-h
route host (require('os').hostname
)-p
listen port (80)-c
virsh connection string (lxc:///
)
Example of a /etc/libvirt/hooks/lxc
(see libvirt hooks)
#!/bin/bash
sudo -H forever restart <path to this project>