Blockland Forums > Modification Help
TCPObject GET requests
<< < (5/10) > >>
Nexus:

--- Quote from: Ipquarx on March 11, 2012, 12:30:50 PM ---Dear god, use the search button.

--- End quote ---

That thread is not a result for any of the following I searched for before posting this:
TCP
TCPObject
TCPObjects
HTTPObjects
TCPObject Downloader
GET Requests
torque downloader
tcpobject header
tcpobject headers

Plus a bunch more in my history

But thanks for linking it
Destiny/Zack0Wack0:
You really shouldn't need to resort to downloading the text file as a binary file. You just make it serve as a text/plain MIME type and then you don't need to do anything, onLine will work fine because it's plain text. The auth error is really weird too.
Ephialtes:

--- Quote from: Nexus on March 07, 2012, 06:01:04 PM ---
--- Code: ---function Downloader::onConnected(%this)
{
      echo("Connected");
      %req = "GET "@$file@" HTTP/1.0\nHost: "@$ip@"\n\n";
      echo(%req);
      %this.send(%req);
}

--- End code ---

--- End quote ---

I'm gonna throw it out there anyway but in the HTTP 1.0 spec you're using for whatever reason, the Host header isn't required and by putting the ip in as the host (incorrect usage) you're almost certainly confusing things. I'd just remove that.

Furthermore lines should be terminated by a CRLF (\r\n) not two line breaks.
Destiny/Zack0Wack0:

--- Quote from: Ephialtes on March 13, 2012, 03:25:21 AM ---
--- End quote ---
I'm ashamed I missed both of those things.
DontCare4Free:

--- Quote from: Ephialtes on March 13, 2012, 03:25:21 AM ---I'm gonna throw it out there anyway but in the HTTP 1.0 spec you're using for whatever reason, the Host header isn't required and by putting the ip in as the host (incorrect usage) you're almost certainly confusing things. I'd just remove that.

--- End quote ---
Provided that the server has virtual hosts enabled, it should stay in there.
(Assuming we're talking about Apache)


--- Quote from: Destiny/Zack0Wack0 on March 12, 2012, 10:36:12 PM ---You really shouldn't need to resort to downloading the text file as a binary file. You just make it serve as a text/plain MIME type and then you don't need to do anything, onLine will work fine because it's plain text. The auth error is really weird too.

--- End quote ---
MIME type shouldn't matter as he's parsing the HTTP himself.
Navigation
Message Index
Next page
Previous page

Go to full version