php - visitor ip changes within 10 seconds -


when visitor enters website, keep track of ip address. when open video on website, send ip address part of encoded url request server streams video. able stream video ip address in decoded url parameter should same url requesting stream.

now noticed not same. understand clearly, if there lot of time between entering website , streaming video, ip can have changed due nat, gateways, etc. happening within time-frame of several seconds. see log file below.

the difference in code between website , streaming server is:

  1. website written in .net -> detect ip using: request.userhostaddress
  2. streaming server uses php stream video. --> detect ip using: $_server['remote_addr'].

what want achieve,that video stream urls on website, surely collected spiders, remote websites etc., can not used downloading or playing video remotely. aware of temp url solution want implement if there no easy way tackle current issue.

my questions:

  1. why happen? using wrong code detect ip address?
  2. any better solution how tackle this?

user: 125.38.245.164 - july 8, 2015, 8:22 pm

attempt: using different ip access: 03bc9af8-18bd-4cf6-9de1-dea70a663306

ip in request:123.151.42.57

ip detected:125.38.245.164

user: 114.4.21.210 - july 8, 2015, 8:23 pm

attempt: using different ip access: 68fa4850-2db7-49e1-b26e-bf37f807ed9c

ip in request:107.167.103.80

ip detected:114.4.21.210

user: 111.206.36.14 - july 8, 2015, 8:23 pm

attempt: using different ip access: af874ac0-ca54-4537-bb0d-4daed5dd98af

ip in request:222.188.143.242

ip detected:111.206.36.14

if user behind proxy may want forwarded header:

$_server['http_x_forwarded_for'] $_server['http_x_forwarded_host']  $_server['http_x_forwarded_server'] 

if of these set, means request coming kind of proxy service.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -