Determine automatically if Host is socket

Instead of requiring user to specify either Host or Socket unify these fields.
It can be automatically determined whether it is a socket or not.