mIRC Home    About    Download    Register    News    Help

Print Thread
HTTP Proxy + SSL (https) possible? #75019 13/03/04 04:47 AM
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
Re: HTTP Proxy + SSL (https) possible? #75020 13/03/04 02:14 PM
Joined: Apr 2003
Posts: 414
Adrenalin Offline
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!
Re: HTTP Proxy + SSL (https) possible? #75021 13/03/04 09:54 PM
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
Re: HTTP Proxy + SSL (https) possible? #75022 13/03/04 10:50 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
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

Re: HTTP Proxy + SSL (https) possible? #75023 13/03/04 11:08 PM
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
Re: HTTP Proxy + SSL (https) possible? #75024 13/03/04 11:10 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
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

Re: HTTP Proxy + SSL (https) possible? #75025 13/03/04 11:13 PM
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
Re: HTTP Proxy + SSL (https) possible? #75026 13/03/04 11:16 PM
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
Re: HTTP Proxy + SSL (https) possible? #75027 13/03/04 11:31 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
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