The connection is a direct P2P connection - if it's getting hung up and not connecting, then sadly someone's computer or network is blocking the connection. GS2 was built using very rudimentary UNet from like 2016, so there's no fancy NAT punchthrough or anything unfortunately. It really relies on all necessary ports being open.
I just dusted off this old executable and was able to establish a connection with a friend, so it's definitely still working.
You and your friend both need to make sure you don't have a firewall blocking the connection - even if you, as the host, have your ports forwarded, if their firewall is blocking incoming traffic on that port, then that's going to cause an issue as well.