vhosts support

Hi 

I've added support for vhosts. Can someone merge please? Thanks

  fintan