amphibian is JSON-RPC to AMP bridge.
AMP is an awesome protocol, but it's inherently binary. While binary support in browsers is improving (ArrayBuffer and Blob), they're still nowhere near widely supported and using them for anything other than their immediate use case (WebGL and the File API, respectively) is incredibly annoying.
Bottom line: anything you send across the WebSocket wire better be 7-bit safe.
Although base64 seems like the obvious solution, you still lack the tools to parse and produce those AMP boxes.
At the same time, browsers everywhere speak JSON, and usually pretty efficiently, too. JSON has a de facto RPC protocol called JSON-RPC which is very similar in many ways to AMP. Hence, it made sense to attempt to proxy them.
amphibian supports JSON-RPC 2.0 encoded as netstrings (the standard for JSON-RPC 2.0 over TCP) over anything you can specify as an endpoint, and, more importantly, JSON-RPC 2.0 encoded as netstrings over WebSockets.
The main difference is that JSON-RPC takes positional arguments whereas AMP generally takes named keyword arguments (with the exception of protocol switching). To fix this, amphibian requires the JSON-RPC parameters array to consist of a single JSON object that has the keyword arguments for the AMP call:
{jsonrpc: "2.0", method: "Command", params: [{x: 1}]}
This maps to:
ampClient.callRemote(Command, x=1)