generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How does ROBLOX send and handle get requests? (HttpService)

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
07 Jul 2016 03:27 PM
from*
Report Abuse
HalfCircuit is not online. HalfCircuit
Joined: 20 Apr 2011
Total Posts: 5018
07 Jul 2016 03:46 PM
What? It sends get requests the same way other services send get requests..?


Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
07 Jul 2016 03:56 PM
But what do they do when they get it back before returning it to Lua?
Report Abuse
Xsitsu is not online. 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
HalfCircuit is not online. HalfCircuit
Joined: 20 Apr 2011
Total Posts: 5018
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
07 Jul 2016 04:15 PM
What would HttpService do with it before returning it to Lua though?
Report Abuse
HalfCircuit is not online. HalfCircuit
Joined: 20 Apr 2011
Total Posts: 5018
07 Jul 2016 04:18 PM
What's the "it" you're referring to?


Report Abuse
Buy1Get2 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
ProtectedMethod is not online. ProtectedMethod
Joined: 01 Apr 2011
Total Posts: 5374
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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
07 Jul 2016 07:38 PM
>calls warspyking a beginner

kms


- Isosta
Report Abuse
cntkillme1 is not online. cntkillme1
Joined: 16 Feb 2012
Total Posts: 592
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 is not online. 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
cntkillme1 is not online. cntkillme1
Joined: 16 Feb 2012
Total Posts: 592
07 Jul 2016 08:04 PM
And returns it to Lua*
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
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
cntkillme1 is not online. cntkillme1
Joined: 16 Feb 2012
Total Posts: 592
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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
08 Jul 2016 11:05 AM
Thank you
Report Abuse
sublevel is not online. sublevel
Joined: 05 Dec 2015
Total Posts: 26
08 Jul 2016 09:01 PM
no problem
Report Abuse
dave2011 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image