in the terminal just write mkdir /home/name, change name to anything u want to call the folder. this creates a folder in /home, years of using vps’ and i cant figure out where to create folders
in the “file” on the topbar of ur vscode hover it and press “open folder”. put the folder path earlier (/home/name) (once again reminding to change name to your folder name earlier)
once u opened the folder create a file called index.js or whatever u want, just remember it
IMPORTANT: install express and node-fetch by typing npm i express node-fetch@2.0.0 in ur terminal (i forgot how to use the http builtin module lol)
when u succesfully created the file i suppose vscode automatically opens the file, so just write this code in it
const express = require("express")
const fetch = require("node-fetch")
const proxy = express()
proxy.get("/", (req, res) => {
const url = req.query.url
fetch(url).then(result => result.text()).then(response => { // requests to the url given
res.send(response)
}).catch(() => res.send("failed lmao"))
})
proxy.listen(8080, () => { console.log("proxy is on") }) // indicates if the port is open (127.0.0.1:8080)
so this would open a port on your vps ip, and the url would be ip:8080 (im pretty sure 8080 is widely used)
15. in the terminal write node index.js (reminder to change index.js to your file name)
16. wait until it says “proxy is on”, since that is what i wrote in the code to indicate if the port is open.
17. if you want to use it on roblox (reminder to enable http reqs in game settings), use
local HttpService = game:GetService("HttpService")
local response = HttpService:GetAsync("http://yourVPSip:8080/?url=https://gyatrizz.org")
print("HTTP RESPONSE", response)
change https://gyatrizz.org to whatever url u want to fetch
keep in mind i didnt test any of these, but it should work