PyAMF:你如何获得客户端的IP地址?

时间:2011-07-26 02:20:53

标签: python flash pyamf

是否有通过WSGI网关接口(Apache)运行PyAMF时获取客户端的IP地址?

1 个答案:

答案 0 :(得分:1)

它位于服务器请求处理程序中的密钥REMOTE_ADDR下。例如,(来自Hello World脚本):

httpd = simple_server.WSGIServer(
    ('localhost', 8000),
    simple_server.WSGIRequestHandler,
)

def app(environ, start_response):
    # environ['REMOTE_ADDR'] is what you're looking for!
    pass

httpd.set_app(app)