Hey Roblox developers,
I wanted to share a tool I wrote awhile back called RbxProxy Lite that can simplify your API request needs for Roblox. This lightweight Node.js application, written in TypeScript, acts as a reverse proxy for various Roblox API endpoints. Here’s how easy it is to set up, deploy, and customize it!
Why RbxProxy Lite?
For security reasons, Roblox blocks the use of HttpService to send requests to roblox.com URLs. To get around this, many developers have created and used “proxy websites” that act as an alternative to sending requests to roblox.com. This repository makes it simple to do so.
- Dynamic Routing: Intelligently routes your requests to different Roblox APIs based on the URL path.
- Express.js Framework: Offers a lightweight and efficient way to handle server-side logic.
- TypeScript: Ensures a strongly typed codebase for better maintainability and scalability.
Supported APIs
Currently supports non-authenticated GET requests for:
This will attempt to forward any requests to specified service after your server URL. /inventory = inventory.roblox.com
Simple Deployment with Vercel
Deploying RbxProxy Lite on Vercel is incredibly straightforward:
- Click the “Deploy with Vercel” button below.
- Follow the prompts to set up your new project.
- In no time, you’ll have your proxy up and running!
Of course, you can deploy this on your own server, the only requirements are Node.js (16+) and TypeScript.
Easy Customization
Want to add your own routes or use authorized endpoints? With the simplicity of RbxProxy Lite’s codebase, you can easily modify it:
- Add custom routes in the
index.ts
file, or the/api
folder. - Insert your
SECURITY_COOKIE
for authorized proxying.
Here’s a quick example of how you can customize your routes:
(You will need to set up environment variables on your Vercel project for it to read from process.env
)
app.use('/newroute/v1', async (req, res) => {
const response = await fetch('https://newapi.roblox.com/v1' + req.url, {
headers: {
'Authorization': `Bearer ${process.env.SECURITY_COOKIE}`,
},
});
const data = await response.json();
res.json(data);
});
Basic Usage
Utilize a route by specifying the end point after your server URL:
/avatar/v1/users/340730/avatar
would route to avatar.roblox.com
while
/games/v2/users/340730/games/
routes to games.roblox.com
Use tools like curl, Postman, or even your browser to directly access the endpoint.
Try a GET request to: https://rbxproxy-lite.vercel.app/games/v2/users/340730/games
Lua Usage
local HttpService = game:GetService("HttpService")
-- Define the URL of your RbxProxy Lite deployment
local proxyUrl = "https://your-vercel-deployment.vercel.app/games/v2/users/340730/games"
-- Function to make the GET request
local function makeGetRequest(url)
-- Using pcall to handle any potential errors
local success, response = pcall(function()
return HttpService:RequestAsync({
Url = url,
Method = "GET",
})
end)
if success and response.StatusCode == 200 then
-- Decoding the JSON response
local jsonData = HttpService:JSONDecode(response.Body)
return jsonData
else
-- Handle any errors
warn("HTTP Request failed or returned non-200 status code:", response and response.StatusCode or "unknown", response and response.StatusMessage or "unknown")
return nil
end
end
-- Call the function and print the result
local result = makeGetRequest(proxyUrl)
if result then
print("Data received:", result)
else
print("Failed to get data")
end
Notes:
Be sure to throttle or cache results to reduce your usage on Vercel.
Local Installation
After cloning the repo:
- Install requirements
npm install
- Compile to JavaScript (for Node)
npx tsc
- Run compiled app
node index.js
Source Code
Please let me know if you have any feedback, or questions!