Add hostname support to open-socket