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

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(); } }
thanks.
Abhishek.

In reply to authenticate to a proxy server [Again!] by abhishes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.