Hey!
I wanted to create a system where I could subscribe to http post requests, and carry them out when they were posted to Roblox.
Normally, from what I know, you can send requests FROM roblox TO some website or localhost. What I want to do is send a request from my terminal and have roblox read the stuff I sent. Something like MessagingService:SubscribeAsync("code", callback)
If I use python, to send a POST request to roblox (localhost:8000), how can I get the json from the request. I was thinking of making something like Rojo but I have no idea how to implement this way of detecting file changes.
The obvious way I could do it is by sending a request every ‘n’ seconds and see if any files were changed, but I don’t think it’s a good way of doing things.
Code sample of what I "want"
HttpService:SubscribeToPost(function(msg)
local data = HttpService:JSONDecode(msg)
print(data)
end)
--Where it will run the callback function every time I send a request.
I couldn’t find anything like this so I might as well make a post, feel free to redirect me, but I might have some questions still.
TBH, The best option would be to just make use of MessagingService, combined with the newish open cloud API. The cloud API allows you to sent post requests from outside of Roblox servers to the messaging service, allowing you to communicate with all the servers that are subscribed to it.
Oh yeah I didn’t think of that. Although I don’t really understand how the open cloud API works and what universe id stuff I have to go through.
Do you have a link to a post or some useful documentation for it? I don’t think the official docs really get the point across, I’ll read them anyway though. Thanks.
The Roblox documentation for it is decent
To get the Universe ID, I find the easiest way is to go to the game page you want to get the ID for, then click the 3 dots and then view analytics. Look at the URL, then copy the number sequence that is shown.
I don’t really care about running the server or doing much of that. I want to make a file manager system that let’s me connect to a
localhost:8000
server and communicate between that. Which I don’t think is what “live servers” means.
(The game wont be running while the CLI is on.)
Also the plugin that’ll connect to the server would be used on every game, and I don’t feel like having people edit API keys and whatnot for a test game that they just want to edit.
That’s not the intended use of Roblox, so I believe that there is support for it. What sort of data are you trying to pass from an external server to the localhost:8000? There may be a better way.
In a code editor, whenever you save or create a file, the python server will send a post request to roblox, with data such as the file path, and the new source of the script.
From my thinking (probably not correct) a way to do this would be to send a post from roblox to the server every ‘n’ seconds and get the data returned. Pretty sure there is a rate limit of 500 requests per minute though.