Since I couldn't find a way to do this, I found out how to do this myself.
I've had scammers visiting & posting spam on my Forums (and ddosing), so I used CloudFlare, but that hides their IPs. This will show you how to restore poster's IPs through cloudflare.
This was done on Ubuntu Server 16.04

Go to the root of your web directory where Flarum is installed
Navigate to /vendor/flarum/core/src/Api/Controller
Then find these two files:
CreateDiscussionController.php
CreatePostController.php

On line 64
Change REMOTE_ADDR to HTTP_CF_CONNECTING_IP

For the PostController, change line 65 REMOTE_ADDR to HTTP_CF_CONNECTING_IP

Now try making a test discussion, along with a test reply to make sure it works, click on the time it was posted on which is next to poster's name, and it should have the real IP there.

I am always happy to see input in regards of making cloudflare easier to use.

Alas, I think you approach can be simplified.

Instead of changing REMOTE_ADDR to HTTP_CF_CONNECTING_IP on each line, you can just set the REMOTE_ADDR to be equal HTTP_CF_CONNECTING_IP. You can also make it only do this if HTTP_CF_CONNECTING_IP is actually set.

This ensure backward compatibility if Cloudflare is turned of.

So anywhere before the IP Check you can add this piece of code:

 <?php if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) 
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
?>

From the Cloudflare support website: https://support.cloudflare.com/hc/en-us/articles/200170876-I-can-t-install-mod-cloudflare-and-there-s-no-plugin-to-restore-original-visitor-IP-What-should-I-do-

Ideally, this should be turned into an extension as to not edit core code.