The relationship itself isn't haram. Knowing someone through online communication and learning more about each other isn't a crime. Adultery and fornication are haram, so if your relationship involves committing adultery then avoid adultery or shameful acts, thoughts etc.