gateway: initialise the handler before setting up the tunnel