[SolidMean] CloudFlare Detect

xF1 Add-on [SolidMean] CloudFlare Detect 1.1.1

No permission to download
Compatible XF Versions
  1. 1.3
  2. 1.4
  3. 1.5
I've re-released this addon with help from a suggestion by @Liam W.

If you are using CloudFlare, and do not already have a means to extract the correct IP address from a visitor, normally done at the web server level, you may need this addon.

This addon will replace the Cloudflare IP of visitors with their actual REMOTE_ADDR IP address. This code is the based on the same code that the CloudFlare Wordpress addon uses.

You may choose to use this add-on if:
  1. Your host will not, or cannot, install a CloudFlare compatible add-on for your web server (i.e.HttpRealipModule for Nginx or mod_cloudflare for Apache).
  2. You don't want to add code suggested by CloudFlare to your config.php or index.php file to try to determine a user's originating/true IP address.
About this Add-On

This add-on, when enabled, will check to see if your site is being served by the CloudFlare system. If it is, it will check to see if the visitors's IP address matches one on CloudFlare's network. If it matches, the user's REMOTE_ADDR is set to the originating IP address (HTTP_CF_CONNECTING_IP).
This add-on supports both IPv4 and IPv6 addresses.

This add-on will be updated with the current list of CloudFlare based IP's on a routine basis. Users who download this add-on can also manually update these IP addresses themselves in the administration options.

This add-on includes a third party function named "ip_in_range" that is packaged with the CloudFlare WordPress add-on, provided by Paul Gregg, located at http://www.pgregg.com/projects/php/ip_in_range/

If you have changed your config.php or index.php file to reassign HTTP_CF_CONECTING_IP to a visitor's IP address, that code can be removed after installing this add-on.

Installation Instructions
  1. Upload contents of "upload" folder to your xenForo installation.
  2. Install the add-on with the "addon-cf_detect.xml" file.
The only options available for this addon is the list of IP4 and IP6 addresses that CloudFlare uses. These options have a link to the IP addresses that CloudFlare uses, and is kept current at all times. You may occasionally want to verify that these options match what CloudFlare says its IP's are, but I will update this addon from time to time when more IP's are added.

More Information

Cloudflare Overview
Cloudflare IP list
Apache and Cloudflare
Nginx and CloudFlare

8.2 KB
First release
Last update

More resources from AnimeHaxor

Latest updates

  1. Updated CloudFlare's IPv4 stack.

    IPv4 IP addresses updated for CloudFlare. You can either install this update, or just update the...

Similar resources

Add your Amazon Affiliate ID and/or eBay Campaign ID to your outgoing URL's
0.00 star(s) 0 ratings
[SolidMean] ForumBackup AnimeHaxor
Schedule backups of your database and XenForo root directory
0.00 star(s) 0 ratings
CloudFlare Anti-Spam AnimeHaxor
Use CloudFlare Tools To Block and Moderator Spam
0.00 star(s) 0 ratings
TPU: Detect and Block Spam Registrations AnimeHaxor
Score based tests to detect and block spammers upon registering
0.00 star(s) 0 ratings
Adds JavaScript detection methods to the base plugin
0.00 star(s) 0 ratings
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I Disabled AdBlock