mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 24
D
dylan Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
I'm trying to write a script that uses a HTTP proxy to post information on a https site and then read the information sent back, Is it possible? Maybe I need a DLL to do this?


-- dylan
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Yap.. That is possible.. You need ssl tunnel program like stunnel.. Check the examples of ussing on their site..
Also to see how your browser works with a proxy you can use a sniffer like Iris.. Often that will save you to read the boring RFC docs..


mIRC Chm Help 6.16.0.3 Full Anchored!
Joined: Dec 2002
Posts: 24
D
dylan Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
Okay, I'll try that. Thanks for your help


-- dylan
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
You can use a COM object called XMLHTTP for that. This script will request a page and return the HTTP response headers:
  • alias getpage {
    .comopen gp Microsoft.XMLHTTP
    !.echo -q $com(gp,Open,1,bstr,Get,bstr,$1,bool,false)
    !.echo -q $com(gp,Send,1)
    !.echo -q $com(gp,GetAllResponseHeaders,1)
    var %result = $com(gp).result
    .comclose gp
    return %result
    }
To test it, try: //echo -a $getpage(http://www.yahoo.com)

Edit: Keep in mind that due to mIRC limitations, you cannot use this object to retrieve a webpage body if it's longer than ~900 characters.

mIRC COM Tutorial
Article from 4GuysFromRolla
MSDN Object Reference

Joined: Dec 2002
Posts: 24
D
dylan Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
That's exactly what I was looking for. What about proxy support though? Do I have to script something else to get it to work with a proxy? Or does it use the proxy specified in Internet Explorer settings?


-- dylan
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
It uses IE's engine, so it follows its proxy settings too laugh

Joined: Dec 2002
Posts: 24
D
dylan Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
Fantastic, thanks a lot!


-- dylan
Joined: Dec 2002
Posts: 24
D
dylan Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2002
Posts: 24
Oh, Also, What would I search for if I wanted more commands (Open, GetAllResponseHeaders, etc) so that maybe I could use this to display an entire webpage?


-- dylan
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Right after $com(gp,Send,1) you can call $com(gp,responseText,2) and $com(gp).result will hold the entire page contents.

For more methods and properties, see the MSDN reference laugh


Link Copied to Clipboard