Hello FP,
I tried a bit to play with http.Fetch(), but I've seen, it doesnt return anything from specific websites, like my forum etc, google works fine though..
[editline]9th August 2015[/editline]
and the error function says "unsuccessfull" is there a limit?
[editline]9th August 2015[/editline]
for the ones that really want my code, this is the one I use for testing only:
[code]
concommand.Add("Fetch", function(ply)
local json = "hai"
http.Fetch("https://platincore.ml", function(c)
print(c)
end, function(err)
print("ERROR: "..err)
end)
end)
[/code]
[editline]9th August 2015[/editline]
Alright I noticed its because of cloudflare, since deactivating it let me get the content, but I dont know which actual option makes it error.
[editline]9th August 2015[/editline]
Is there a way for robotboy/garry to implement a feature for it to work like a normal cURL/fsockopen request, since I can get contents of "not working" urls fine per php.
You should add your servers external default ip, to cloudflares trusted list.
[QUOTE=hio77;48419380]You should add your servers external default ip, to cloudflares trusted list.[/QUOTE]
Oh boy, I want to make an addon which uses the API of the website, and they are on cloudflare too, and I dont think they'd want to add everybody to the whitelist who downloads it, why doesnt http.Fetch work like cURL and stuff, since PHP works fine.
[QUOTE=whitestar;48421420]Oh boy, I want to make an addon which uses the API of the website, and they are on cloudflare too, and I dont think they'd want to add everybody to the whitelist who downloads it, why doesnt http.Fetch work like cURL and stuff, since PHP works fine.[/QUOTE]
This is the complex way but may work, use the api on your website if they have php and then just fetch your site?
[QUOTE=SteppuFIN;48421723]This is the complex way but may work, use the api on your website if they have php and then just fetch your site?[/QUOTE]
Thats the thing, my website uses CF too, I am thinking of making a data/api domain which doesnt use Cloudflare, but for now I am waiting for their response if theres maybe a way to whitelist all IPs by default, since cloudflare is pretteh shweet.
Get rid of 'https' and try 'http'
Sorry, you need to Log In to post a reply to this thread.