Receiving HTTP requests in Roblox?

And there isn’t even a super hacky custom implementation? Aside from what I mentioned.

The only solution is polling from the server, AKA what you mentioned.

2 Likes

Okay, thanks.

Edit: Probably going to make a module which makes implementing the method I said easy and open source it. Thanks!

2 Likes

Do you have any idea how long it takes for HTTP requests to timeout? It doesn’t say on the wiki and can’t find anything on Google… :thinking:

1 Like

curl has a timeout of 2 minutes (how roblox sends requests), and it also depends on your web server setup. nginx will hold requests just fine (if you configure it to do so), but if its through cloudflare, it will timeout pretty fast.

I’m a little confused.

I am using Express on Google App Engine. If Roblox sends a request to the server, Roblox will timeout after 2 mins, correct? Does the time it takes for Cloudflare, etc, effect that (I am considering using cloudflare).

1 Like

I haven’t tested express timeout (even though i use express), I based the 2 minutes off the default curl timeout, and the fact i’ve used long polling previously without issue on roblox’s end. Cloudflare will return an error if the origin doesnt respond within 15 seconds.

For my personally, i just poll every 15 seconds, send information, and receive information, works quite well.

Okay, thanks. I am considering creating some crappy implementation of a game server on Roblox as a proof of concept. That’s why I need this. Thanks for the help!

You can achieve the desired functionality with HTTP long polling. Here’s a blog post about it: Updating Roblox Game Servers in Realtime with HTTP Long Polling | Matthew Dean

4 Likes

Thanks! It’d be nice to see a proper implementation, though. Obviously not any time soon. Is anything like that on the roadmap?

WebSockets would be a nice addition also.

3 Likes

I agree, however the idea was rejected.

1 Like

Or possibly Webhooks.

2 Likes

That was posted quite a while ago, without any information regarding how exactly it was a security issue.

The situation may have changed now.

This is very helpful, thank you! However one concern I have is that won’t sending requests in a while loop hit a brick wall in terms of rate limits roblox-side?

1 Like

Not if you send under 500 requests/min.

Honestly, i think they misinterpreted it. I wanted a client-implementation, like the roblox server makes an outgoing socket to our own server, instead of us making a socket to the roblox server. Could be wrong.

3 Likes

Just make a REST api and make your game listen for new data and if its new it does something

you can pool from the server side, this is a project I made about, let me know if it is useful GitHub - pollovolante/RobloxWS: poll connection with Roblox experiencies

you can use HTTP Request, and your server, you can haul all the requests, and whenever you need to you just send responses to them whenever you want. They will infinitely wait so it’ll count as one request per response.