http.Fetch doesnt fetch specific(?) websites

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:



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)


[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.

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.

This is the complex way but may work, use the api on your website if they have php and then just fetch your site?

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’