I understand topics like this already exist, but none of which help me. I’m using JavaScript. How can I send HTTP requests to roblox?
I’m not sure if that is possible, but you’ll have to create and api or some sort.
I have the API set up. Is there any way that you know of?
I don’t know if thats an option. They don’t want anyone DDosing their servers…
Making a api proxy server of some sort will allow you to connect to the proxy via HTTP, which then retrieves the data through HTTPS and returns it back on to the proxy.
What do you mean? Do you want to send requests to the Roblox API from your JavaScript application?
No, I mean to the Roblox client, or whatever it is.
You can’t. You’ll have to use a third party proxy site (e.g. RoProxy)
So you want to send HTTP requests to the Roblox app?
Example code (edited version of code that I use for my own proxy server)
const request = require('request')
const express = require('express');
const app = express();
app.get('/', (req, res) => {
const options = {
url: 'https://example.com/api-url',
headers: {
'Authorization': 'AUTH HERE',
}
};
request(options, function(e, r, bod) {
if (!e) {
res.send(bod)
}
});
});
simply change url to what ever you are trying to return (e.g /users/{userid}
) and make a Get request to your server URL (through HTTP)
And boom, it should return (as an example)
{
"Id": 12345678,
"Username": "user name"
}
You CANT make Requests to Roblox. Any Site even if it’s promocodes.roblox.com .but that doesn’t mean it’s impossible.
You have to Use a Proxy for it to Work.You are using a External Server Built on JS. So you can do GET Requests to a Proxy there are many like RoProxy.
Though i would like to add one more thing. Proxies can’t be relied on for crucial stuff so if u are using Proxies to build a plugin on top of it.its gonna be risky but minor requests won’t hurt even other plugins do that.
For who’s wondering: OP wants to send requests to Roblox game servers
Short answer: you can’t
Detailed answer: roblox does not allow listening for external requests so you will need to use what is called “long polling”, basically the data you would send from your server to Roblox must be kept until a request is sent from a roblox server to get it. This means that you will need to constantly query your api with a loop (add a decent debounce if you don’t want to ddoss yourself) and request the data to the endpoint which sends it.
An example:
Your web server wants to send some data to Roblox, you can’t so do the following:
- hold the data
- send a request from roblox to get the data
- make your web server send the data
- (tip) remove the data from the web server to not take up too much space and resources
- repeat the process
Result: long polling