In my search of something similar to this I found the unfortunately named WAMP (Web Application Messaging Protocol). Despite its goal of being simple and easy to implement, I found the spec complex and bloated. It doesn't stick to being a messaging protocol, also defining routing and brokerage - unnecessarily so in my opinion. I subscribe to the single-responsibility principle, and WAMP seems to violate that.
So I wrote up this RPEP spec (https://github.com/Tixit/RPEP) and want to know what people think about it. I also implemented the spec in javascript (https://github.com/Tixit/rpep.js). If anyone wants to contribute to RPEP by either making implementations in other languages or discussing changes to the spec, please let me know.