虎泰克博客

$_SERVER['REMOTE_ADDR']在https网站上获取到的ip和http网站上获取到的不一致


今天写一个程序需要在两个网站(一个https,一个http)间传递用户的基本数据,然后带上签名,签名

今天写一个程序需要在两个网站(一个https,一个http)间传递用户的基本数据,然后带上签名,签名的字符串里包含ip,本想着靠ip来验证客户端,结果调试的时候发现接收端一直抱Invalid Signature,于是将$_SERVER['REMOTE_ADDR']获取到的ip打印出来结果发现两个网站获取到的ip不一致(https:211.161.153.65 http:211.161.155.33),于是tracert两个网站ip,结果可以看到,前面几个跳点都是在武汉市局域网内,而后到出口ip的时候就不一致了,然后猜想长城宽带根据目的ip位置划分不同的出口ip。

blob.png

虎xg泰vj克qysfa新bto闻kz网jaj版权所有,请勿未授权转载!!!

下图是在百度里输入ip查询到的本机ip,结果发现和上面的也不一样,应该就是猜想的那样。(https :这锅我不背。

blob.png



Statement: all articles / drawings reproduced on this website are for the purpose of transmitting more information and facilitating discussion, which does not mean that the website, the host and the organizer agree with their opinions or confirm the authenticity of their contents. The contents of the articles are for reference only. If the rights of the original author are violated, please contact the website administrator.

Sign in to comment

Comment list

    No data