Hello,
I am experimenting wrapping external process stdin and stdout to a web
service using simple uWSGI.
The demo is like this:
def hello_app(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
proc = subprocess.Popen("echo hello world", shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return environ['wsgi.file_wrapper'](proc.stdout)
This works in wsgiref
from wsgiref.simple_server import make_server
make_server('', 8086, hello_app).serve_forever()
But not in uWSGI
uwsgi --http 0:8086 --wsgi bj:hello_app
It returns zero sized http response
(and not working in bjeron, too, shows errno 22.)
Anyone can share any insights of what's going on? What's the proper way if
I want to wrap external program stdout to the interwebz?
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi