Need help about restoring visitor IPs for an ASP-based forum


#1

Hi, I’m very new with CloudFlare, which I use for my ASP-based forum site. I’m also no ASP-expert or coder. But I managed to modify some of the forum’s asp files with the help of expert instructions to add some capabilities/mods.

My problem: I noticed that I can’t anymore see the original IP numbers of visitor members after I signed up with CloudFlare. I checked some support pages and solutions about it in the CF site but almost all of them are about linux-based platforms, if I’m not mistaken.

Do you know if it is possible for me to check original IPs of forum members somewhere in my forum’s server-side applications or files? Or a simple code addition or modification to restore original IP display? Thanks.


#2

Cloudflare always includes Visitor IPs in the HTTP Request headers:


#3

For iterating all server variables:

<%
for each x in Request.ServerVariables
  response.write(Request.ServerVariables(x) & "<p />")
next
%>

For client country:

<%Response.Write(Request.ServerVariables("Cf-Ipcountry"))%>

For original client IP address:

<%Response.Write(Request.ServerVariables("CF-Connecting-IP"))%>


#4

I thank you both for your answers :slight_smile:


Cloudflare always includes Visitor IPs in the HTTP Request headers


I remember reading this but due to my lack of knowledge about the subject, I don’t know how can I access these headers to get the visitor IP data in each case, if this is what is implied to do. Or am I supposed to add one of the code-like statements (such as "“CF-Connecting-IP: A.B.C.D” to one of the main asp files in my site directory? Or to the “head” section of a specific html file?


For iterating all server variables:

<%
for each x in Request.ServerVariables
response.write(Request.ServerVariables(x) & “<p />”)
next
%>

For client country:

<%Response.Write(Request.ServerVariables(“Cf-Ipcountry”))%>

For original client IP address:

<%Response.Write(Request.ServerVariables(“CF-Connecting-IP”))%>


I conclude that “all server variable” means these codes apply to any kind of server including a windows/asp one. And again, because of my lack of knowledge, am I supposed to add one or some of these codes to a specific file in my site’s directory?


#5

I don’t use ASP, but I found this (scroll about halfway down for “Cloudflare”):


#6

HTTP headers are some texts as key, value pairs available from inside of any of your asp files. You can list all or access one of them from the collection if you know the key.
Create a sample asp file and test provided code and when it is ok move the code to main page(s).


#7

OK, Xaq, I’ll try to create an asp file in my site’s file directory to include the codes you provided above. Then I think I’m supposed to open/view that asp file in my web browser to check if it produces any relevant data.


#8

Yes, it works, I think. I mean, after I created an asp file with the above codes and called it from the browser, it displayed not only the CloudFlare IP, but also my original IP along with some amount of other data. But I don’t know how I can utilize this method to see other members’ IP addresses when they access and post in the forum. Normally, I could use a “show IP” button in each new post. I think I can’t use that feature anymore.

I might try to put the same codes into some of the relavant asp files of the forum (such as those displaying user profiles or recent messages) to see if this provides the original IPs of accessing/posting members but I’m hesistant about it as that can produce a piece of text with IP’s on the related forum pages seeable by all visitors, and, even worse, this could mean a breakdown of normal page view.

If you don’t have a specific advice on this, I will think about referring to the community help pages of the creators of the forum software I use. I thank you all anyway :=)


#9

I’m wondering who uses asp classic these days. Consider moving to new platforms.


#10

Yeah, I know. I’m searching for a suitable solution for converting to something phb.


#11

I need help to achieve this in a mybb forum


#12

I don’t think MyBB is ASP-based. These solutions won’t help you.