Hello,
Remote desktop cannot connect to a local port unless you are using other network technology to transfer network to other port.
You can use official link as a reference: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients
If the Answer is helpful, please click "Accept Answer" and upvote it.