- fix use libwebsocket_write().
- support dynamic allocate.