Revert "removed unused functions"

Will support websocket client, after all.

This reverts commit 2ad1bb7b4c454ea2070fee72f246ccb60328ca91.