This issue is most likely due to an active firewall between you and your friend's computer. One quick way to solve this problem is to find the port that you are using and running sudo ufw allow followed by the port number that you are using.