Ping host before connect and send a json data