|
| 07 Jul 2016 03:26 PM |
| I'm curious about what happens starting form the function call to send the GET request, to whatever it returns back. Anybody have an explanation? |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jul 2016 03:46 PM |
What? It sends get requests the same way other services send get requests..?
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 03:56 PM |
| But what do they do when they get it back before returning it to Lua? |
|
|
| Report Abuse |
|
|
Xsitsu
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 2921 |
|
|
| 07 Jul 2016 04:00 PM |
Roblox uses cURL for their Http stuff. The call looks something like
>get data in from parameters >build Http object >pass object to cURL http-doer >get response back
Not exactly sure how that response is returned back though. |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:05 PM |
It just returns the data stream, and you can catch it by assigning the method invocation to a variable
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:15 PM |
| What would HttpService do with it before returning it to Lua though? |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:18 PM |
What's the "it" you're referring to?
|
|
|
| Report Abuse |
|
|
Buy1Get2
|
  |
| Joined: 13 Aug 2014 |
| Total Posts: 6383 |
|
|
| 07 Jul 2016 04:28 PM |
go here if you are unfamiliar with roblox's http service because you are just a beginner lol: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=159742126
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:38 PM |
I'm not a beginner lol. I'm talking about more advanced things than simply making the request.
I'm asking what HttpService does the result before returning it to Lua |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 04:57 PM |
| All that I care about is that they don't give you access to the headers. Ugh |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 07:30 PM |
@Prot
http://wiki.roblox.com/index.php?title=API:Class/HttpService/GetAsync http://wiki.roblox.com/index.php?title=API:Class/HttpService/PostAsync
You can |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 07 Jul 2016 07:38 PM |
>calls warspyking a beginner
kms
- Isosta |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 08:03 PM |
| It just reads the page and pushes the returns the string to Lua, I don't see what you're confused about. |
|
|
| Report Abuse |
|
|
SerGregor
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7957 |
|
|
| 07 Jul 2016 08:04 PM |
no he isnt a beginner
(he legit over-uses metatables though.. it's cool and stylish.. but most of the time i dont understand the logic in them, so yeah) |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jul 2016 10:25 PM |
@cnt Well, that's it, it doesn't do anything with it before giving it back?
@Ser Usually just for fun, I'd never recommend any of it to other people for real use xD |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2016 10:31 PM |
| I don't think ROBLOX really does anything with it. They definitely don't filter it as you can see plenty of profanity in the output depending on what site you requested data from. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2016 12:56 AM |
| Why would it do anything else? It just sends a GET request and returns the data, there's no need to do anything else? |
|
|
| Report Abuse |
|
|
sublevel
|
  |
| Joined: 05 Dec 2015 |
| Total Posts: 26 |
|
|
| 08 Jul 2016 02:18 AM |
When a HTTP request function is called, it makes a call to a function that handles a few errors.
It checks if HttpService is enabled It checks if you’re a client or a server If there are too many HTTP requests Unrecognized HttpService
Then the function that was linked to Lua by the linker is called (Example: GetAsync; game:GetService("HttpService"):GetAsync("http://www.roblox.com"); ). Then the request is made and is passed to the trust check. The trust check will allow and deny requests. It determines which requests will come and go. Then a packet is crafted. If a request is not allowed through the trust check, it will output the error: "trust check failed".
The packet buffer will look like this in ASCII format:
“GET / HTTP/1.1..Host: www.roblox.com..User-Agent: Roblox/WinInet..Accept: */*..Accept-Encoding: deflate, gzip..Roblox-Id: NUMERICIDHERE....”
"www.roblox.com" isn't the actual host, because you can't make requests to ROBLOX, the trust check will also throw an exception for this.
The function that sends the packet is winsock:send, most of the time when the server/client model sends and receives packets, it uses winsock:sendto and winsock:recvfrom. HTTP requests happen to use winsock:send and winsock:recv. ROBLOX uses Raknet, but Raknet has to communicate with Winsock on Windows.
When the data being returned from the host is being received, depending on the size of the data, their may be packet fragmentation so the packets will split, but still be pieced together.
GET = specify it’s a GET request HTTP 1.1 = First version of the protocol Host: www.roblox.com = host to that the GET request is sending to User-Agent: To specify the user agent
The concept behind this is that ROBLOX sets up a socket and socket address structure like this:
Socket_Family = AF_INET Socket_Type = Sock_Stream Socket_Protocol = Unknown // Default to TCP
SocketAddress.sin_family = AF_INET SocketAddress.sin_addr.s_addr = inet_addr(ip(“http://www.roblox.com”)) SocketAddress.sin_port = htons(80 or 443) // Because HTTP is port 80 and HTTPS is port 443
Then they connect the socket to the socket address, and then send and receive on the socket. The same socket that sent the request, will receive the data the host returns. The function that calls winsock:recv in this instance is called from directly from Lua bytecode.
Nothing else is really done on the receiving part.
|
|
|
| Report Abuse |
|
|
| |
|
sublevel
|
  |
| Joined: 05 Dec 2015 |
| Total Posts: 26 |
|
| |
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 08 Jul 2016 09:05 PM |
sublevel what experience do you have to know all that? Did you major in CS in college? or what?
My siggy is a lie |
|
|
| Report Abuse |
|
|
sublevel
|
  |
| Joined: 05 Dec 2015 |
| Total Posts: 26 |
|
|
| 08 Jul 2016 09:23 PM |
my experience is me going into junior year of hs are u trying to call me an old man or something ;/// ill have u know ur insults do NOT WORK!! |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 08 Jul 2016 09:24 PM |
how did you learn all that?
My siggy is a lie |
|
|
| Report Abuse |
|
|