Mike Christensen
Mike Christensen

Reputation: 91726

In C#, can you find what proxy server your computer is using?

I've noticed some programs (such as IE and Firefox) can automatically detect a network proxy server to use for Internet traffic. Is it possible to do the same in C#? Are there APIs for this? Thanks!

Upvotes: 4

Views: 3153

Answers (2)

millimoose
millimoose

Reputation: 39990

You're probably looking for WebRequest.DefaultWebProxy or possibly WebRequest.GetSystemWebProxy. This should be able to pick up whatever IE detects.

Also, other SO questions indicate that HttpWebRequest will go through your system proxy by default.

Upvotes: 5

Randolpho
Randolpho

Reputation: 56448

HttpWebRequest.Proxy

Upvotes: 1

Related Questions