A way to turn a HTTP client into a service provider

Remote Procedure Call mechanism

The AjaxSync RPC mechanism is somewhat restricted. It allows allows you to export any function which has only one string parameter; that parameter string may, however, contain binary data.

If you want to transport multiple parameters or complex data structures, you will have to encode and decode data. That could be done with JSON or XML; both are supported by JavaScript natively. However, in another language they may be supported or not, you may have to rely on foreign libraries.

Be aware that if you are calling such an exported function from another AjaxSync client, you are basically doing a broadcast, or better said a multicast, whereas the AjaxSync server will decide which clients will receive this call. The caller has no possibility to see which (if any) clients could receive the call, and on which clients the call actually was successful. On that reason, you have no return value, neither from the function call itself nor from its success state.