Port forwarding is only required on the server. Any packets bound for the client will be auto-forwarded from the initial request thanks to the action on many NATs.
So, you only need to forward the port on the server. If using Socket
and ServerSocket
you need to forward TCP if your router gives you the choice. If using DatagramSockets
, forward UDP at either of the endpoints.
(if you had to forward on clients, you most likely wouldn't have been reading this page without forwarding port 80)