469,128 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,128 developers. It's quick & easy.

vb.net and autoproxy

This seemed so easy at the beginning...

I have a need to use xml data from a web server inside a vb.net program.
During development it worked great - then came the real world.

Some of the people who will use my application use autoproxy.
They cannot access the web server directly, nor do they have proxy
server information hard coded in their registries.

Oh, and I'm using the .net 1.1 runtime (Visual Studio .net 2003)

Does anyone know how to get out through a web proxy, determined by
autoproxy, in vb.net and the 1.1 .net runtime?

--
DM
personal opinion only
Apr 2 '06 #1
11 8619
David Moss <q0******@mail.connect.usq.edu.au>'s wild
thoughts were released on Sun, 02 Apr 2006 00:25:05 GMT
bearing the following fruit:
This seemed so easy at the beginning...

I have a need to use xml data from a web server inside a vb.net program.
During development it worked great - then came the real world.

Some of the people who will use my application use autoproxy.
They cannot access the web server directly, nor do they have proxy
server information hard coded in their registries.

Oh, and I'm using the .net 1.1 runtime (Visual Studio .net 2003)

Does anyone know how to get out through a web proxy, determined by
autoproxy, in vb.net and the 1.1 .net runtime?


You need to ask in a dotnet group, this one if for VB6

Jan Hyde (VB MVP)

--
When ancient wall sculptors were finished, it was a relief. (David Kahn)

Apr 4 '06 #2
In article <73********************************@4ax.com>,
St***********@REMOVE.ME.uboot.com writes...
David Moss <q0******@mail.connect.usq.edu.au>'s wild
thoughts were released on Sun, 02 Apr 2006 00:25:05 GMT
bearing the following fruit:
This seemed so easy at the beginning...

I have a need to use xml data from a web server inside a vb.net program.
During development it worked great - then came the real world.

Some of the people who will use my application use autoproxy.
They cannot access the web server directly, nor do they have proxy
server information hard coded in their registries.

Oh, and I'm using the .net 1.1 runtime (Visual Studio .net 2003)

Does anyone know how to get out through a web proxy, determined by
autoproxy, in vb.net and the 1.1 .net runtime?


You need to ask in a dotnet group, this one if for VB6


If you mean microsoft.public.dotnet.vb my question seems to be the only
posting in there at this end. There has been no traffic in there for a
week.

I can't see any other .net specific newsgroups through my ISP.

Hence my posting to a group that has vb in the title but no other
qualifiers.

I'm actually very sorry I moved from vb5 to .net.
I was forced to do it for a Uni course I was doing.
Since then I have not been able to write MS Office interactions and now
there is this autoproxy issue. In vb5 I would have had this project done
in under a week. In .net it looks like not getting done at all.

I will probably have to fall back on plain old HTML and PHP to build the
user interface. Thats so 10 years ago, but it seems to be my only
option.

--
DM
personal opinion only
Apr 4 '06 #3
> I can't see any other .net specific newsgroups through my ISP.

You don't need your ISP to view Microsoft's public newsgroups. Set up a
newsgroup account using msnews.microsoft.com for the server... this will
expose all of the Microsoft newsgroups to you... you can filter them down to
the dotnet ones easily enough from there. You might also try filtering on
vsnet to see if there are any .NET groups there that are of interest.

Rick
Apr 5 '06 #4
David Moss <q0******@mail.connect.usq.edu.au>'s wild
thoughts were released on Tue, 04 Apr 2006 22:48:34 GMT
bearing the following fruit:
In article <73********************************@4ax.com>,
St***********@REMOVE.ME.uboot.com writes...
David Moss <q0******@mail.connect.usq.edu.au>'s wild
thoughts were released on Sun, 02 Apr 2006 00:25:05 GMT
bearing the following fruit:
>This seemed so easy at the beginning...
>
>I have a need to use xml data from a web server inside a vb.net program.
>During development it worked great - then came the real world.
>
>Some of the people who will use my application use autoproxy.
>They cannot access the web server directly, nor do they have proxy
>server information hard coded in their registries.
>
>Oh, and I'm using the .net 1.1 runtime (Visual Studio .net 2003)
>
>Does anyone know how to get out through a web proxy, determined by
>autoproxy, in vb.net and the 1.1 .net runtime?
You need to ask in a dotnet group, this one if for VB6


If you mean microsoft.public.dotnet.vb my question seems to be the only
posting in there at this end. There has been no traffic in there for a
week.

I can't see any other .net specific newsgroups through my ISP.

Hence my posting to a group that has vb in the title but no other
qualifiers.


Yes, well, that's microsoft's fault for calling two entirely
different languages 'vb'
I'm actually very sorry I moved from vb5 to .net.
I was forced to do it for a Uni course I was doing.
Since then I have not been able to write MS Office interactions and now
there is this autoproxy issue. In vb5 I would have had this project done
in under a week. In .net it looks like not getting done at all.
Look at the object having the problem, it will most likely
have a proxy property. You can create a proxy class and and
provide the users credentials, set the proxy property = to
this and you should be able to get through the proxy (NB:
this might not be acurate there are examples on the web
though)

J
I will probably have to fall back on plain old HTML and PHP to build the
user interface. Thats so 10 years ago, but it seems to be my only
option.

Jan Hyde (VB MVP)

--
One of my friends got me a novelty card deck that had pictures of nude models on the backs, but my wife said she just couldn't deal with it.
(David Reihmer)

Apr 5 '06 #5
In article <ao********************************@4ax.com>,
St***********@REMOVE.ME.uboot.com writes...
Look at the object having the problem, it will most likely
have a proxy property. You can create a proxy class and and
provide the users credentials, set the proxy property = to
this and you should be able to get through the proxy (NB:
this might not be acurate there are examples on the web
though)


Thanks, but this only works if the user is savvy enough to know their
proxy server address or the proxy has been directly entered in the
Internet Explorer proxy settings.

When an autoproxy is used there is no proxy information available in the
registry. Autoproxy retrieves a javascript file from the address in the
autoproxy entry and processes that file for each URL to determine where
the proxy for a particular domain is.

In a complex organisation different proxy servers might be used for the
Internet and different parts of the organisation, while other parts may
bypass the proxy altogether.

If I find a solution I will post it back into this thread.

--
DM
personal opinion only
Apr 8 '06 #6

"David Moss" <q0******@mail.connect.usq.edu.au> wrote in message
news:MP************************@news.bigpond.com.. .
In article <ao********************************@4ax.com>,
St***********@REMOVE.ME.uboot.com writes...

Thanks, but this only works if the user is savvy enough to know their
proxy server address or the proxy has been directly entered in the
Internet Explorer proxy settings.


I am curious about why are you having to mess with a proxy at all?
I thought your client app would specify a web address, for either a web page or
a web service, and make its request. If there is some proxy-stuff going on
behind the scenes to get you connected to that address, so what?
If one of the users enters www.google.com in a browser, presumably they get
taken to that site, regardless of the hoops in between. How is your app
different?
I would actually like to know, since I am embarking on some corporate web
development, and may be running through proxies in some cases.
Apr 8 '06 #7

I am curious about why are you having to mess with a proxy at all?
I thought your client app would specify a web address, for either a web
page or a web service, and make its request. If there is some proxy-stuff
going on behind the scenes to get you connected to that address, so what?
If one of the users enters www.google.com in a browser, presumably they
get taken to that site, regardless of the hoops in between. How is your
app different?
I would actually like to know, since I am embarking on some corporate web
development, and may be running through proxies in some cases.


This also interests me as that is ment to be one of the big features of
..Net. I had lots of trouble trying to use the Internet transfer controll in
VB6
to get data to or from a web server when ever a proxy got involved. I spent
hours in the late 90's working out the WinInet API to get it to do as you
suggest.
I have moved to 2005 for new stuff that I am working on but have not had to
do any web services yet, I just assumed all that stuff was sorted out.

I found www.vbip.com the best place for all this stuff.
Apr 8 '06 #8
"Steve Gerrard" <my********@comcast.net>'s wild thoughts
were released on Sat, 8 Apr 2006 09:53:09 -0700 bearing the
following fruit:

"David Moss" <q0******@mail.connect.usq.edu.au> wrote in message
news:MP************************@news.bigpond.com. ..
In article <ao********************************@4ax.com>,
St***********@REMOVE.ME.uboot.com writes...

Thanks, but this only works if the user is savvy enough to know their
proxy server address or the proxy has been directly entered in the
Internet Explorer proxy settings.

I am curious about why are you having to mess with a proxy at all?
I thought your client app would specify a web address, for either a web page or
a web service, and make its request. If there is some proxy-stuff going on
behind the scenes to get you connected to that address, so what?


If your behind a proxy server you can't do anything without
providing credentials. Even the VB.Net IDE doesn't work
correctly from behind a proxy.
If one of the users enters www.google.com in a browser, presumably they get
taken to that site, regardless of the hoops in between. How is your app
different?
No you wouldn't, you'd at best be propted for the proxy
authentication, at worsed be denied access.
I would actually like to know, since I am embarking on some corporate web
development, and may be running through proxies in some cases.


Best thing is to try it from behind a proxy yourself and see
what a PITA it is.


Jan Hyde (VB MVP)

--
Inheritance: Will gotten gains (Stan Kegel)

Apr 10 '06 #9
"Max Healey" <ma***@healey.com.au>'s wild thoughts were
released on Sun, 9 Apr 2006 08:16:56 +1000 bearing the
following fruit:

I am curious about why are you having to mess with a proxy at all?
I thought your client app would specify a web address, for either a web
page or a web service, and make its request. If there is some proxy-stuff
going on behind the scenes to get you connected to that address, so what?
If one of the users enters www.google.com in a browser, presumably they
get taken to that site, regardless of the hoops in between. How is your
app different?
I would actually like to know, since I am embarking on some corporate web
development, and may be running through proxies in some cases.


This also interests me as that is ment to be one of the big features of
.Net. I had lots of trouble trying to use the Internet transfer controll in
VB6
to get data to or from a web server when ever a proxy got involved. I spent
hours in the late 90's working out the WinInet API to get it to do as you
suggest.
I have moved to 2005 for new stuff that I am working on but have not had to
do any web services yet, I just assumed all that stuff was sorted out.

I found www.vbip.com the best place for all this stuff.


Could I suggest we start a new thread about this in a
'dotnet' group, we really are off topic here,

Jan Hyde (VB MVP)

--
Apprenticeship: Hire learning (Leopold Fechtner)

Apr 10 '06 #10

"Jan Hyde" <St***********@REMOVE.ME.uboot.com> wrote in message
news:1g********************************@4ax.com...
"Steve Gerrard" <my********@comcast.net>'s wild thoughts
were released on Sat, 8 Apr 2006 09:53:09 -0700 bearing the
following fruit:
If one of the users enters www.google.com in a browser, presumably they get
taken to that site, regardless of the hoops in between. How is your app
different?


No you wouldn't, you'd at best be propted for the proxy
authentication, at worsed be denied access.


Just as I feared, I don't know squat about proxy servers. I don't think that is
what we have at work after all; in fact, I've never seen such a thing. If Google
don't work, your Internets are broken, that's what I say.

Apr 11 '06 #11
In article <44**********************@news.optusnet.com.au>,
ma***@healey.com.au writes...

I am curious about why are you having to mess with a proxy at all?
I thought your client app would specify a web address, for either a web
page or a web service, and make its request. If there is some proxy-stuff
going on behind the scenes to get you connected to that address, so what?
If one of the users enters www.google.com in a browser, presumably they
get taken to that site, regardless of the hoops in between. How is your
app different?
I would actually like to know, since I am embarking on some corporate web
development, and may be running through proxies in some cases.


This also interests me as that is ment to be one of the big features of
.Net. I had lots of trouble trying to use the Internet transfer controll in
VB6
to get data to or from a web server when ever a proxy got involved. I spent
hours in the late 90's working out the WinInet API to get it to do as you
suggest.
I have moved to 2005 for new stuff that I am working on but have not had to
do any web services yet, I just assumed all that stuff was sorted out.

I found www.vbip.com the best place for all this stuff.


Thanks for the link Max.

As to proxy and autoproxy, it is relevant to all flavours of VB, its
just a bit harder with VB.NET because you can't just bring in a COM
object to help.

Heres a quick synopsis of proxy:

Direct connection: exactly what it says. If your VB app needs to access
a URL it connects to the server directly and gets it. This isn't really
a problem for the home user or small office with a few workstations, but
it can result in unnecessary multiple downloads of the same file in a
larger setup. Imagine a small group of, say, 5 stockbrokers in an office
sharing a single 128kb/s ISDN feed. Every morning at 9am they all look
at the stock exchange home page to see the market news. Without proxy it
will take 5 times as long as it should to retrieve the page as all 5 of
them will be trying to pull it down the 128k feed at the same time.

Hard-coded proxy: all URLs are downloaded from the same proxy server.
This helps eliminate the problem of multiple downloads. With a proxy
server in the office the file would be pulled down the slow 128k link
once, stored in a cache, and shared out among the 5 brokers at 10, 100
or 1000Mb/s. In a small to medium site a single hard-coded proxy address
is OK, but in large operations (mine has 100,000 users or more in it) a
single proxy server would itself become a bottleneck. With a hard-coded
proxy the address and port of the proxy server are recorded in the
registry.

Autoproxy: Instead of recording an address and port for a proxy server
in the registry, the URL of a file that contains advanced proxy
information is recorded. There is often no actual proxy address or port
available in the registry. Instead a javascript file, usually named
autoproxy.pac, is automatically downloaded the first time a URL is
requested. The FindProxyForURL() method is called in this javascript
with the desired URL as a parameter and it returns the correct proxy
address and port to use with that URL. This allows multiple proxy
servers to be run by the organisation, each optimised for a particular
kind of information. For URLs inside the local Intranet DIRECT might be
returned by FindProxyForURL(), allowing for direct access to files that
do not have to be retrieved over slow links. Information from different
departments might be obtained from that department's own proxy server
while Internet files may be obtained through one or more proxy servers
shared by the whole organisation.

My own organisation has hundreds of thousands of users, thousands of
sites and dozens of departmental Intranets. It is a very big site, but
fairly typical of very large multinational companies. Because of the
size and complexity of the organisation autoproxy is used on nearly all
workstations.

An added advantage of proxy servers is they can be set up to require
authentication. That means people inside an organisation have no trouble
accessing local files directly, but a username and password is needed
before they can access files on the Internet, or perhaps files from
other departments. This can have immense productivity implications, both
positive and negative.

If you are a person who only uses Internet Explorer, proxy and autoproxy
are magical background helpers that speed your data flow.

If you are a programmer, proxy and autoproxy are industrial grade
headaches that stop your application getting to the data it needs
without a lot of extra work.

The trick is finding out what kind of proxy system is in use, if any,
and tailoring the data access accordingly.

Direct connection: no worries. It just works.

Hard-coded proxy is a little harder: you can find details of the hard-
coded proxy address and port in the registry under
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="Proxy.Mycompany.com:8080"

VB has ways of obtaining this information from the registry, so its just
a matter of reading it and using information with your objects as Jan
suggested.

Autoproxy is harder still. There is often no hard-coded proxy server or
port at all in the registry, instead the location of the autoproxy
script is available:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet
Settings]
AutoConfigProxy=wininet.dll
AutoConfigURL=http://autoproxy.mycompany.com

Knowing WHERE the information lives is useful, but it is up to YOU the
programmer to parse the autoproxy.pac file that lives there for each URL
and set up a proxy on your objects accordingly.

A complicating factor is that a proxy server often requires
authentication details. Internet Explorer simply pops up a
username/password dialog when this occurs. Your program will have to
deal with this situation automatically.

So your program may need to detect the kind of proxy in use and act
accordingly. In the "worst case" it may need to parse a javascript file
to determine the appropriate proxy server and deal with user
authentication when it connects.

Oh, and just to cap it off, the information in the autoproxy.pac file
may change from access to access. Suppose a proxy server goes down for
maintenance or fails. The network administrator can change the data flow
throughout the organisation simply by changing a single line in
autoproxy.pac. Ideally your program has to be able to deal with a
dynamic network environment, detect failures, reload autoproxy.pac and
reconfigure proxy on its objects accordingly. Second place goes to the
program that crashes and has to be restarted to reload up to date proxy
information when a network reconfiguration occurs.

I hope this helps some people get to grips with proxy and autoproxy.
I've tried to keep my discussion generic so it will apply to all
flavours of VB. Have a great day everyone.

--
DM
personal opinion only
Apr 11 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.