【问题标题】:Lua HTTP request in ROBLOX is giving me a 403, but works on when testing in other placesROBLOX 中的 Lua HTTP 请求给了我一个 403,但在其他地方测试时可以正常工作
【发布时间】:2018-12-03 17:29:06
【问题描述】:
local httpService = game:GetService("HttpService");
local s = httpService:GetAsync("https://rbxapi.herokuapp.com/api/Users/1");
print(s);

这是一个发送到我的代理服务器的简单 GET 请求,但它继续给我一个 403 错误。

HTTP 403(HTTP/1.1 403 禁止)

API tester 等其他网站上测试 URL 时,它完全可以正常工作并通过测试。

代理服务器托管在heroku上,这是服务器的代码:

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}!`);
    }
})

【问题讨论】:

    标签: javascript heroku proxy lua roblox


    【解决方案1】:

    已解决,ROBLOX 知道它来自游戏服务器,因此拒绝它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-27
      • 2018-09-10
      • 2020-04-22
      • 1970-01-01
      • 2013-10-22
      • 2014-05-25
      • 1970-01-01
      • 2017-06-19
      相关资源
      最近更新 更多