Connecting Stata to the Internet through a proxy server

 

Disclaimer: I am not associated to StataCorp in any way. The purpose of this webpage is only to describe some useful programs and techniques for the Stata platform.


> How to connect Stata to the Internet through a proxy server without a password

Most proxy servers requiere authentification. If this is not the case (no user and password), you can use these commands:

.set httpproxy on

.set httpproxyhost "yourproxyhost"
[Note: replace "proxy.something.com" with your proxy hostname or IP address]

.set httpproxyport 8080
[Note: most often, the proxy port is 8080, however other port numbers may also be used]


> How to connect Stata to the Internet through a proxy server with a password

As far as I know, this simple procedure has not been properly documented. Therefore, I decided to post it here.

If you are not sure about the parameters to use, contact your network administrator (or your IT department).

.set httpproxy on

.set httpproxyhost "proxy.something.com"
[Note: replace "proxy.something.com" with your proxy hostname or IP address]

set httpproxyport 8080
[Note: most often, the proxy port is 8080, however other port numbers may also be used]

set httpproxyauth on

set httpproxyuser "user"
[Note: replace "user" with your proxy user]

set httpproxypw "password"
[Note: replace "user" with your proxy password]


> How to see if it's working.

Try a Stata command which requires an Internet connection and see if it works.

Example:

.findit logistic

If Stata displays a screen with results, it means that it is working correctly.

If an error is displayed instead, it is not working:

(contacting http://www.stata.com)

r(601);


> Do I have to type these commands every time I open Stata?

No. You may include them in the profile.do file and they will get executed every time you open Stata.


> What is a proxy server?

The detailed technical explanation is extensive. The basic idea is that when you are connecting to a proxy server, you don't have direct access to the Internet and you may have to use a special configuration for certain programs, such as Stata.

If you are connecting to the Internet from a University, a Research Center or a large Corporation, you are very likely to be connecting through a proxy server. If Stata is not configured to use a proxy server, the commands that imply a connection to the internet (such as "findit" or "ssc install") will not work.