> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的“eurasia-users”论坛。
> 要向此网上论坛发帖,请发送电子邮件至 eurasi...@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至 eurasia-user...@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/eurasia-users?hl=zh-CN 访问此网上论坛。
>
>
--
人生苦短, Pythonic!
俺: http://about.me/zoom.quiet
开: http://code.ijinshan.com/
豆: http://www.douban.com/group/zoomquiet
书: http://code.google.com/p/openbookproject
蟒: http://code.google.com/p/kcpycamp/wiki/PythoniCamp
On 12月12日, 下午1时35分, bawbaw hu <bawbaw...@gmail.com> wrote:
> 想在某一 path 下使用 wsgi 的服务如 phprpc 、hprose,其它path 例如 /crossdomain.xml
> 时,使用httpserver
> 这样子有办法使用沈大那段吗?
新增的接口是 wsgi(app) 返回一个普通的 http handler。
from eurasia.web import httpserver, wsgi, mainloop
def app(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['hello world!']
def handler(httpfile):
wsgihandler = wsgi(app)
wsgihandler(httpfile)
httpd = httpserver(':8080', handler)
httpd.start()
mainloop()
请重新下载快照,或者从 3.1 的 svn 更新。
文档 wsgiserver 一节已随之更新。