Blockland Forums > Modification Help

Password Protected Web Connections

Pages: (1/2) > >>

LundoomGaming:

Can anyone explain to me (explain it, don't just yell out some extremely complicated code that makes my face sore) how to connect to a web page (using a TCPObject) that has a password on it, such as the site below
http://psp-networks.com/testing/

Thanks

Brian Smithers:

your probably going to have to modify the HTTP Requests to include the password stuff.
gonna do some testing real quick, except a ton of requests.
yark, just kept on saying page not found.
just tried using a HTTPObject and it gave me some HTTP unauthorized. :| Sorry idk

Destiny/Zack0Wack0:

If it's only basic authorization: use a TCPObject and send the "Authorization" header.

Authorization: Basic <base64 encoded user/pass pair>

Where <base 64 encoded user/pass pair> is the base 64 encode of the string <username>:<password>.

LundoomGaming:


--- Quote from: Destiny/Zack0Wack0 on April 11, 2012, 09:44:20 PM ---If it's only basic authorization: use a TCPObject and send the "Authorization" header.

Authorization: Basic <base64 encoded user/pass pair>

Where <base 64 encoded user/pass pair> is the base 64 encode of the string <username>:<password>.

--- End quote ---

Again, not good with TCP. Where should I put this?
Also, how do I get the base64 encoded string?

Brian Smithers:


new TCPObject(blah);
blah.connect("url:80");
%header = "GET /index.html HTTP/1.0\r";
%header = %header NL "Authorization: Basic " @ base64("username:password") @ "\r\n";
blah.send(%header);

this is like a torque psuedo code sort thing. There aren't the exact function names and this isn't the exact headers, but it's a good idea of what it should look like.

Fixed kalph

Pages: (1/2) > >>

Go to full version