abhishes has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl monks,
This is a repeat question... so please don't get annoyed for asking it again. I didn't understand the replies in the first thread ...so I am brining up the question again.
I connect to the internet via a proxy server. the proxy server is NOT NTLM ... I am sure because I am able to browse the web thru mozilla. if it was NTLM then only IE will work. My proxy server is also not SOCKS.
I suppose it is just a plain proxy server which needs loginid and password before it forwards the request out of our network.
I have searched many times google and this site ... but I cannot find how can I do this in perl.
In my search I was able to find a C# program which did the very same thing which I want. Please let me know how can I do the same thing in perl
thanks.using System; using System.IO; using System.Net; public class TestNet { public static void Main(string[] args) { string url = "http://www.perlmonks.com"; HttpWebRequest req = (HttpWebRequest) WebRequest.Create(url); + WebProxy proxy = new WebProxy("proxy.server.intranet:8080"); proxy.Credentials = new NetworkCredential("user", "password"); req.Proxy = proxy; HttpWebResponse resp = (HttpWebResponse) req.GetResponse(); + StreamReader reader = new StreamReader(resp.GetResponseStream()); + while(reader.Peek() > -1) { Console.WriteLine(reader.ReadLine()); } reader.Close(); resp.Close(); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: authenticate to a proxy server [Again!]
by integral (Hermit) on Feb 22, 2003 at 18:40 UTC | |
|
Re: authenticate to a proxy server [Again!]
by toma (Vicar) on Feb 23, 2003 at 08:36 UTC | |
by abhishes (Friar) on Feb 23, 2003 at 11:31 UTC | |
by toma (Vicar) on Feb 23, 2003 at 17:59 UTC | |
|
Re: authenticate to a proxy server [Again!]
by Anonymous Monk on Feb 23, 2003 at 01:10 UTC |