473,809 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a proxy and a port with WebRequest...

It's not often I ask questions but here goes...

I am writing a site that does Instant Payment Notification processing
through PayPal and I need to use HttpWebRequest to hit an HTTPS server at
their site to verify a transaction. The trouble is that the site I'm hosting
on uses a proxy and a port for https so I have to make the request use this
instead.

I would normally do this....

httpWebRequest =
(HttpWebRequest )WebRequest.Cre ate(https://www.paypal.com/cgi-bin/webscr);

but somehow I need to proxy this through a server with an IP address of
123.123.123.123 on port 3128.

Can someone point me in the right direction??


--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Nov 19 '05 #1
3 10540
Check out the HttpWebRequest. Proxy property

-Brock
DevelopMentor
http://staff.develop.com/ballen
It's not often I ask questions but here goes...

I am writing a site that does Instant Payment Notification processing
through PayPal and I need to use HttpWebRequest to hit an HTTPS server
at their site to verify a transaction. The trouble is that the site
I'm hosting on uses a proxy and a port for https so I have to make the
request use this instead.

I would normally do this....

httpWebRequest =
(HttpWebRequest )WebRequest.Cre ate(https://www.paypal.com/cgi-bin/websc
r);

but somehow I need to proxy this through a server with an IP address
of 123.123.123.123 on port 3128.

Can someone point me in the right direction??

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Nov 19 '05 #2
proxy element in config

Eg:
<system.net>
<defaultProxy >
<proxy
usessystemdefau lt = "false"
proxyaddress = "http://123.123.123.123 :3128"
bypassonlocal = "true"
/>
</defaultProxy>
</system.net>
Gabriel Lozano-Morán
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl...
It's not often I ask questions but here goes...

I am writing a site that does Instant Payment Notification processing
through PayPal and I need to use HttpWebRequest to hit an HTTPS server at
their site to verify a transaction. The trouble is that the site I'm
hosting on uses a proxy and a port for https so I have to make the request
use this instead.

I would normally do this....

httpWebRequest =
(HttpWebRequest )WebRequest.Cre ate(https://www.paypal.com/cgi-bin/webscr);

but somehow I need to proxy this through a server with an IP address of
123.123.123.123 on port 3128.

Can someone point me in the right direction??


--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Nov 19 '05 #3
Thanks. That was the trick I was looking for.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Brock Allen" <ba****@NOSPAMd evelop.com> wrote in message
news:56******** **************@ msnews.microsof t.com...
Check out the HttpWebRequest. Proxy property

-Brock
DevelopMentor
http://staff.develop.com/ballen
It's not often I ask questions but here goes...

I am writing a site that does Instant Payment Notification processing
through PayPal and I need to use HttpWebRequest to hit an HTTPS server
at their site to verify a transaction. The trouble is that the site
I'm hosting on uses a proxy and a port for https so I have to make the
request use this instead.

I would normally do this....

httpWebRequest =
(HttpWebRequest )WebRequest.Cre ate(https://www.paypal.com/cgi-bin/websc
r);

but somehow I need to proxy this through a server with an IP address
of 123.123.123.123 on port 3128.

Can someone point me in the right direction??

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12024
by: Manfred Braun | last post by:
Hi All, I am trying to access xml-files in the internet from my intranet-page. Making XmlDocument.Load() calls internally works fine, but not so to the internet. I think the calls are failing, because we use a proxy-server. Can I specify a specifix proxy in the call and/or in the configuration-files? For the configuration-files, I am not finding samples, which point out how to specify username and password. For the XmlDocument, I even...
2
13293
by: vipin | last post by:
Hi All, I am looking for a sample c# program which demonstrates how to create a webrequest(http) and send it to a webservice (specified using port no.) thank you vipin
10
25147
by: Abubakar | last post by:
hi, I work on a computer that is part of a network and uses proxy to connect to net. I cant connect to servers outside my proxy with simple ConnectTo code. I need to know how to make my requests go through proxy. eg, _socket = new TcpClient("http://msdn.microsoft.com", port); does not work. Thanx. Ab.
6
12487
by: Jensen Bredhal | last post by:
Hello, I need to send command to a web server from a method. I understand this should be possible using the WebClient or WebRequest class. how can this be done? below an example of my HTTP based command to the server:
0
2843
by: deepak | last post by:
Hi All, i m develpoing a .net Window application which has 4 texboxes(tbxURLmfor URL in URL Frame,tbxAddress for address in Proxy server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy script in proxy script frame) and a test button..The requirment is given below STEP BY STEP GUIDE 1. Input the URL you want to test 2. Choose Proxy script/Proxy server with Address and Port Information/No proxy 3. Enter url to...
0
1827
by: Maxx57 | last post by:
C# VS.Net 1.1 (2003) - trouble with using IE proxy server settings I've got a program that detects if it can connect to a webservice. It sends a System.Net.WebRequest and then checks the information it gets back to findout if it can connect to the service properly. If there is an error it will catch an exception and everything is fine. This used to work wonderfully, until somebody decided they needed to use a proxy server. (rats!) It's...
1
4006
by: moo | last post by:
Is there a simple way to get my logon credentials to make my web request work through our proxy server? I tried CredentialCache.DefaultCredentials, but I get nothing back. I can get it to work if I just create a new NetworkCredential object specifying user, password and domain. But, I would rather get that info automatically if possible, rather than presenting a winform for them to type it in. Lastly, why do both the request object and...
3
5482
by: =?Utf-8?B?UmljaGFyZEBub3NwYW0ubm9zcGFt?= | last post by:
My webcam app runs OK on XP but not on Vista. Here's my code snippet that has been working up until now: System.Net.WebRequest request; System.Net.WebResponse response; request = System.Net.FileWebRequest.Create( "http://store.bearvalley.com/live/camimage_00001.jpg"); response = request.GetResponse(); When it tries to execute the request.GetResponse() call I get the following
4
4472
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get this exception: System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream...
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.