Javascript ROBLOX中的LuaHTTP请求给了我一个403,但在其他地方测试时仍然有效
这是一个发送到我的代理服务器的简单GET请求,但它继续给我一个403错误 HTTP 403(禁止使用HTTP/1.1 403) 当在其他网站(如)上测试URL时,它可以完全正常工作并通过测试 代理服务器托管在heroku上,这是服务器的代码:Javascript ROBLOX中的LuaHTTP请求给了我一个403,但在其他地方测试时仍然有效,javascript,heroku,proxy,lua,roblox,Javascript,Heroku,Proxy,Lua,Roblox,这是一个发送到我的代理服务器的简单GET请求,但它继续给我一个403错误 HTTP 403(禁止使用HTTP/1.1 403) 当在其他网站(如)上测试URL时,它可以完全正常工作并通过测试 代理服务器托管在heroku上,这是服务器的代码: local httpService = game:GetService("HttpService"); local s = httpService:GetAsync("https://rbxapi.herokuapp.com/api/Users/1");
local httpService = game:GetService("HttpService");
local s = httpService:GetAsync("https://rbxapi.herokuapp.com/api/Users/1");
print(s);
解决了这个问题,ROBLOX知道它源于一个游戏服务器,因此拒绝了它
const _express = require("express"),
_proxy = require("express-http-proxy"),
_fs = require("fs");
_body_parser = require("body-parser")
var client = _express();
var port = process.env.PORT || 5000;
client.use("/api", _proxy("https://api.roblox.com", {
proxyReqPathResolver: function(req){
return require('url').parse(req.url).path;
},
}));
client.listen(port, (err) =>{
if(err){
console.log(`Error: ${err}`);
return;
} else {
console.log(`Server is now listenin' on port ${port}!`);
}
})