Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ROBLOX中的LuaHTTP请求给了我一个403,但在其他地方测试时仍然有效_Javascript_Heroku_Proxy_Lua_Roblox - Fatal编程技术网

Javascript ROBLOX中的LuaHTTP请求给了我一个403,但在其他地方测试时仍然有效

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");

这是一个发送到我的代理服务器的简单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");
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}!`);
    }
})