Flask获取远程ip地址为127.0.0.1
通过flask获取到的远程ip地址为:127.0.0.1,解决方法如下:
If there is a proxy in front of Flask, then something like this will get the real IP in Flask:
if request.headers.getlist("X-Forwarded-For"): ip = request.headers.getlist("X-Forwarded-For")[0] else: ip = request.remote_addr
    博客里大都是转载的内容,其目的主要用户知识的组织和管理。
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号