Add support to connect both with and without BOSH.