473,231 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

Creating a Web Proxy

I use Godday.com for hosting.
What I'm trying to do is create a web proxy.
This is the code I have currently:


<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Page Language="VB" Debug="true" %>
<script language="VB" runat="server">
Dim u
Dim wc as WebClient
Dim st as Stream
Dim sr as StreamReader
sub page_load
U = Request("u")
if U = "" then
U = "http://www.quiddity128.net"
end if

wc = new WebClient()
wc.Credentials = System.Net.CredentialCache.DefaultCredentials
st = wc.OpenRead(u)
sr = new StreamReader(st)
'Response.Write(sr.ReadToEnd())
myPage.Text = sr.ReadToEnd()
st.Close()
end sub
</script>

<form runat="server">
<input type=text size=50 name="u">
<input type=submit>
</form>

<asp:literal id="myPage" runat="server"/>
Now, aslong as the search pages are on godaddy's server...it works fine.
As soon as you request something like www.microsoft.com or yahoo.com, it
returns a error

The error returned is
Exception Details: System.Net.WebException: The remote server returned
an error: (401) Unauthorized.

Source Error:
Line 18: wc = new WebClient()
Line 19: wc.Credentials = System.Net.CredentialCache.DefaultCredentials
Line 20: st = wc.OpenRead(u)
Line 21: sr = new StreamReader(st)
Line 22: 'Response.Write(sr.ReadToEnd())
Does anyone know what I'm doing wrong and how to fix this problem?
Nov 19 '05 #1
2 2009
Chamander2kool wrote:
I use Godday.com for hosting.
What I'm trying to do is create a web proxy.
This is the code I have currently:


<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Page Language="VB" Debug="true" %>
<script language="VB" runat="server">
Dim u
Dim wc as WebClient
Dim st as Stream
Dim sr as StreamReader
sub page_load
U = Request("u")
if U = "" then
U = "http://www.quiddity128.net"
end if

wc = new WebClient()
wc.Credentials = System.Net.CredentialCache.DefaultCredentials
st = wc.OpenRead(u)
sr = new StreamReader(st)
'Response.Write(sr.ReadToEnd())
myPage.Text = sr.ReadToEnd()
st.Close()
end sub
</script>

<form runat="server">
<input type=text size=50 name="u">
<input type=submit>
</form>

<asp:literal id="myPage" runat="server"/>
Now, aslong as the search pages are on godaddy's server...it works
fine. As soon as you request something like www.microsoft.com or
yahoo.com, it returns a error

The error returned is
Exception Details: System.Net.WebException: The remote server
returned an error: (401) Unauthorized.

Source Error:
Line 18: wc = new WebClient()
Line 19: wc.Credentials =
System.Net.CredentialCache.DefaultCredentials Line 20: st =
wc.OpenRead(u) Line 21: sr = new StreamReader(st)
Line 22: 'Response.Write(sr.ReadToEnd())
Does anyone know what I'm doing wrong and how to fix this problem?


You're using your ASP.NET account's credentials. Is that really what
you want?

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2
most likely the hosts proxy only allows local access from the server for
your account.

-- bruce (sqlwork.com)
"Chamander2kool" <vz******@verizon.net> wrote in message
news:JdvOd.16108$uc.15834@trnddc08...
| I use Godday.com for hosting.
| What I'm trying to do is create a web proxy.
| This is the code I have currently:
|
|
|
|
| <%@ Import Namespace="System.Net" %>
| <%@ Import Namespace="System.IO" %>
| <%@ Page Language="VB" Debug="true" %>
| <script language="VB" runat="server">
| Dim u
| Dim wc as WebClient
| Dim st as Stream
| Dim sr as StreamReader
| sub page_load
| U = Request("u")
| if U = "" then
| U = "http://www.quiddity128.net"
| end if
|
| wc = new WebClient()
| wc.Credentials = System.Net.CredentialCache.DefaultCredentials
| st = wc.OpenRead(u)
| sr = new StreamReader(st)
| 'Response.Write(sr.ReadToEnd())
| myPage.Text = sr.ReadToEnd()
| st.Close()
| end sub
| </script>
|
| <form runat="server">
| <input type=text size=50 name="u">
| <input type=submit>
| </form>
|
| <asp:literal id="myPage" runat="server"/>
|
|
| Now, aslong as the search pages are on godaddy's server...it works fine.
| As soon as you request something like www.microsoft.com or yahoo.com, it
| returns a error
|
| The error returned is
| Exception Details: System.Net.WebException: The remote server returned
| an error: (401) Unauthorized.
|
| Source Error:
|
|
| Line 18: wc = new WebClient()
| Line 19: wc.Credentials = System.Net.CredentialCache.DefaultCredentials
| Line 20: st = wc.OpenRead(u)
| Line 21: sr = new StreamReader(st)
| Line 22: 'Response.Write(sr.ReadToEnd())
|
|
| Does anyone know what I'm doing wrong and how to fix this problem?
Nov 19 '05 #3

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

Similar topics

2
by: William Ryan | last post by:
I just loaded VS2003 on a new machine and when I try to create a ASP.NET app or Web Service, I get the following error: "Visual Studio could not create or open application because your browser...
0
by: AA | last post by:
Hello, I need to create a soap proxy from this schema.. http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-2 but the wsdl.exe does not work :( The xsd.exe create classes...
19
by: Steve | last post by:
Can anyone point me to a primer for creating OCX controls in VB .net? In particular, I want to access a web service in a VB6 application (not an easy thing to do). So, if I can write an ActiveX...
1
by: Jeevan | last post by:
Hi , I am working on developing an ASP.NET server control that is based on AJAX and need to call a webservice on a remote domain. To avoid the security warning from IE , I created a proxy...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
6
by: | last post by:
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to...
0
by: jackfrancy | last post by:
Hi , When I tried to create web reference (Proxy Class) from WSDL.EXE or Visual Studio 2003 web Reference Tool Following error has occurred . “The error message from each known type may help...
1
by: Bill Woodruff | last post by:
Visual Studio 2005, .NET FrameWork 2.0, C#, WinForms Application Hi, I've read the recent posts by and to 'Thunderbird' (and learned a lot, thanks, from the usual masters Skeet and Paladino,...
0
by: =?Utf-8?B?UlN1Yg==?= | last post by:
Hello, Hope I am asking this question in the right forum. We have been given a Wsdl file and the webservices link from a client. I am trying to invoke their web service first by creating a proxy...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.