To configure Remote Desktop Services correctly for internet access or any time where firewalls are used, it is useful to know what ports are required.
The information / taxonomy is broken down by role service/component, and lists all inbound/outbound ports used.
Information for Terminal Server in Windows Server 2008 is at http://support.microsoft.com/KB/832017#method26 The ports used have not changed in Windows Server 2012 | R2. The summary follows.
How to configure which ports (if need to set to specifics) http://support.microsoft.com/kb/154596/
From a proxy standpoint, the regkey HKLM\Software\Microsoft\TermServLicensing\lrwiz\Params shows the Microsoft service that the RD LS communicates with. e.g. clearinghouse.one.microsoft.com