how to get ip behind NAT using php?

前端 未结 5 473
夕颜
夕颜 2020-12-11 19:03

Is it possible to retrieve IP behind NAT in PHP? I am using $_SERVER[\"REMOTE_ADDR\"] for getting IP address of the client. It\'s not giving exact IP address of

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 19:41

    You cannot see the private address of client and usually you don't care to see it beacuse you can't access that. Even if it used a proxy, sometimes you may get address by:

     $_SERVER['HTTP_X_FORWARDED_FOR']
    

提交回复
热议问题