save memory by use a reasonable buffer size and increase as necessary
add more test; move websocket test to a new file