msg-rpc provides bidirectional RPC support over a simple message interface such as WebSocket. Tere are WebSocket examples based on socket.io and sockjs. It just has a simple sendMessage/onMessage interface, with no other dependencies. It supports not only normal RPC, but also RPC Service, which makes RPC pushable (i.e. the server can also send a request to the client and expect some kind of response).