CURLOPT_PORT (3) - Linux Manuals
CURLOPT_PORT: set remote port number to work with
NAMECURLOPT_PORT - set remote port number to work with
DESCRIPTIONThis option sets number to be the remote port number to connect to, instead of the one specified in the URL or the default port for the used protocol.
Usually, you just let the URL decide which port to use but this allows the application to override that.