Author Topic: TCP using Hostinger Error  (Read 827 times)

I recently attempted to learn how to use TCP Objects, but apparently either I'm doing something wrong, or you can't use TCPs with Hostinger.
Here's what I've done:

new TCPObject(TCPTest);

function TCPTest::onLine(%this, %line)
{
    echo("LINE:" SPC %line);
}

function TCPTest::onConnected(%this)
{
    %this.send("GET /AdminRules.html /HTTP1.0\nHost: cruxeis.url.ph\nUser-Agent: Torque\n\r\n\r\n");
}

TCPTest.connect("cruxeis.url.ph:80");

And this is the error it gives me:

And I'm pretty sure the file hasn't moved..
Anyone know how to fix this? Am I forgetting an \r or something?

It's a redirect. My TCPClient support script handles this quite well.

Look here: http://forum.blockland.us/index.php?topic=257317.0


connectToURL("http://www.cruxeis.url.ph/AdminRules.html", "GET", "", "");

? Or do I have to specify every parameter?


connectToURL("http://www.cruxeis.url.ph/AdminRules.html", "GET", "", "");

? Or do I have to specify every parameter?

http://greek2me.us/code/Support_TCPClient.html#connectToURL

Set the savePath if you want to save it to a file.

Set the class and then define class::handleText(%this, %line) if you want to work with the data directly.
« Last Edit: June 26, 2014, 10:14:43 PM by Greek2me »