Add better host handling
Add functional tests for connection change