Share core logic between ssh and tcp transports
Use shared discover in http as well