ip-address

getting ip address using PHP in case you are running VPN

三世轮回 提交于 2019-12-04 21:25:01
I am using VPN, and thus if i check http://whatismyip.com it will give me different ip than $_SERVER['REMOTE_ADDR'] or getenv('REMOTE_ADDR') . whatismyip gives my original ip address while $_SERVER or getenv gives my VPN ip address !! is there anyway to get my original address ip using php in case that i am running VPN? and is there any way to get the PROXY IP address using PHP if i am using proxy also? Thanks No. Whatever PHP (rather the web server) returns is the address that the request was made from. There's no way for the script to know if you're behind a VPN or proxy. Try the following -

Getting IP addresses of the PC's available on wifi network in android

自古美人都是妖i 提交于 2019-12-04 20:53:12
I am able to establish connection between android and PC via Wi-fi. But this is done by hard coding the the IP address of the PC (server) in the android program. But I wanted to get IP addresses of the PC's available on the Wi-fi network programmatically. So please let me know how to scan for PC's on the network and get their respective IP address. Sam Holder can you not multicast a UDP packet on the network which the server listens for and responds to with a packet containing the ip address of the server in order to set up the connection? You should be able to find help on that topic, with

PHP Curl, retrieving Server IP Address

╄→гoц情女王★ 提交于 2019-12-04 20:32:06
问题 I'm using PHP CURL to send a request to a server. What do I need to do so the response from server will include that server's IP address? 回答1: This can be done with curl, with the advantage of having no other network traffic besides the curl request/response. DNS requests are made by curl to get the ip addresses, which can be found in the verbose report. So: Turn on CURLOPT_VERBOSE. Direct CURLOPT_STDERR to a " php://temp " stream wrapper resource. Using preg_match_all() , parse the resource

Browser IP Address

坚强是说给别人听的谎言 提交于 2019-12-04 20:20:09
I have 2 apps 1 Ruby (not written by me. I understand nothing of Ruby) and the other ASP.Net The Ruby app determines the users's IP address (I'm told "using first IP found in "HTTP_X_FORWARDED" )and passes a hashed version of it to the ASP.Net app. The ASP.Net app then determines the Client's IP address again (using Request.UserHostAddress) and hashes the value. Then hashes are compared. Generally these hashes are identical ( as you might expect) for all our clients. However we have 1 new client for which this is not the case... Every computer at his workplace apparently produces hashes which

Calculate variation of IP addresses column using MySQL

做~自己de王妃 提交于 2019-12-04 20:14:08
I'm trying to detect people using proxies to abuse my website. Often they will change proxies and so forth. But there is definitely a pattern of them using one proxy address many times. Much more than is normal for legitimate visitors. Usually most accessing of my website is by unique ip addresses that have only visited once or a few times. Not repeatedly. Let's say I have these ip addresses in a column: 89.46.74.56 89.46.74.56 89.46.74.56 91.14.37.249 104.233.103.6 That would mean there are 3 uniques out of 5. Giving a "uniqueness score" of 60%. How would I calculate this efficiently using

Postgres Check if IP (inet) is IN a list of IP Ranges

丶灬走出姿态 提交于 2019-12-04 19:56:47
问题 I want to check if an IP exists in a range of ranges, eg: SELECT * FROM ip_address WHERE ip IN (<list of ip ranges>) Postgresql documentation states to use the << operator to check if an IP is contained within a single IP Range, eg: inet '192.168.1.5' << inet '192.168.1/24' , but I'm not sure how to use it on a list of ranges without having to construct an OR chain of <<'s. 回答1: select inet '192.168.1.5' << any (array['192.168.1/24', '10/8']::inet[]); ?column? ---------- t http://www

Is there a library function to determine if an IP address (IPv4 and IPv6) is private/local in C/C++?

六月ゝ 毕业季﹏ 提交于 2019-12-04 19:47:13
1, Given a 32-bit integer value, how to exactly determine if it is private IPv4 address. 2, Given a 128-bit integer value, how to exactly determine if it is private IPv6 address. Consider the byte order of the IP address on different platforms, it is error-prone to write such a common little function every time. So I think there should be a library function for this, is there? This will get you started. I didn't bother including the "link local" address range, but that's an exercise left for you to complete by modifying the code below. IPV6 is slightly different. And your question is slightly

IPv4/IPv6 network calculations and validation for Java?

陌路散爱 提交于 2019-12-04 18:53:23
问题 I am looking for a package that is similar to Net_IPv4 and Net_IPv6 but written for Java. It needs to be able to do the following: Verify an address is valid (e.g. 127.0.0.1 is valid, 127.0.0.257 is not) Return if an address is contained within a subnet (e.g. 127.0.0.11 is in 127.0.0.0/28) Return the broadcast address for a given subnet (e.g. for 127.0.0.0/28 it's 127.0.0.15) It would be awesome if it could also: Return a list of addresses for a subnet in order Sort a list of addresses I

Pointing DNS name to IP address on local machine

时间秒杀一切 提交于 2019-12-04 18:29:16
This might be a stupid question but i would really appreciate any compact answer. I have uploaded a Joomla site on my local machine using a static IP address (213.221.211.111 for example). I have registered a domain (like www.example.com) on Godaddy.com. Within their dashboard, I set the primary and secondary name servers (I looked it from my router setup page). Is there any else I need to do so that entering e.g. www.example.com would take the user to 213.221.211.111. Inside of godaddy, you need to map "www" to your static IP address. It would be a good idea to also map the default entry for

Restricting access to a site using IP address

南笙酒味 提交于 2019-12-04 16:41:32
I would like to know whether there is a way of restricting the users of a site such that they can only access the inner pages of a site if they are within a certain range of IP addresses or a certain network? The current PHP scripts I am getting cant differentiate the real IPs from the Proxies? Thanks i wouldn’t restrict on ip addresses. as you said, you can’t know if it’s a proxy. furthermore, ip addresses can be easily spoofed. Miha Hribar Have you considered using apache .htaccess files for that? IP restriction with htaccess You can try out a script I created that allows very advanced IP