The computer needs an ip address and port number to determine the service you are using. The port of proxy server can be customized or added with authentication.
The proxy server only needs to provide you with the server address, which port you connect to when you need proxy service, and the user name and password (if anonymity is allowed, it is not needed).
You don't need to pay attention to which port the proxy server goes out to visit the destination.