base: support for sending binary frames over a websocket.

Fixes #629.