Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 533389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:30:13+00:00 2026-05-13T09:30:13+00:00

I work in a office which requires all connections to be made through a

  • 0

I work in a office which requires all connections to be made through a specific http proxy. I need to write a simple application to query some values from a webserver – it’s easy if there were no proxy. How can I make the C# application proxy-aware? How can I make any sort of connection through a proxy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:30:14+00:00Added an answer on May 13, 2026 at 9:30 am

    This is easily achieved either programmatically, in your code, or declaratively in either the web.config or the app.config.

    You can programmatically create a proxy like so:

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("[ultimate destination of your request]");
    WebProxy myproxy = new WebProxy("[your proxy address]", [your proxy port number]);
    myproxy.BypassProxyOnLocal = false;
    request.Proxy = myproxy;
    request.Method = "GET";
    HttpWebResponse response = (HttpWebResponse) request.GetResponse();
    

    You’re basically assigning the WebProxy object to the request object’s proxy property. This request will then use the proxy you define.

    To achieve the same thing declaratively, you can do the following:

    <system.net>
      <defaultProxy>
        <proxy
          proxyaddress="http://[your proxy address and port number]"
          bypassonlocal="false"
        />
      </defaultProxy>
    </system.net>
    

    within your web.config or app.config. This sets a default proxy that all http requests will use. Depending upon exactly what you need to achieve, you may or may not require some of the additional attributes of the defaultProxy / proxy element, so please refer to the documentation for those.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work in an office which has been doing Agile for a while now.
When I am at the office, MySQL runs on a specific server which is
Does VSTO 2008 work for Office 2010 or will it only be VSTO 2010?
I want to buy a brand new notebook for out-of-the-office work. I mainly develop
At work I work closely with MS-Office. I have managed to generate some scripts
I am doing some COM Interop work with Excel and other Office Automation Software.
Work on this small test application to learn threading/locking. I have the following code,
I'm current on POS project. User require this application can work both online and
I have inherited an application built using the Microsoft Office Information Bridge Framework 1.6.
I have a coworker who was no longer work the same office. He has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.