If you're using Tor Browser, you can set your proxy's address, port, and authentication information in the Network Settings.
If you're using Tor another way, you can set the proxy information in your torrc file. Check out the
HTTPSProxy config option in the manual page. If your proxy requires authentication, see the
HTTPSProxyAuthenticator option. Example with authentication:
We only support Basic auth currently, but if you need NTLM authentication, you may find this post in the archives useful.
For using a SOCKS proxy, see the
Socks5Proxy, and related torrc options in the manual page. Using a SOCKS 5 proxy with authentication might look like this:
If your proxies only allow you to connect to certain ports, look at the entry on Firewalled clients for how to restrict what ports your Tor will try to access.