refine streaming for proxy.py