The CORS patch allows a daemon node to answer CORS (Cross-Origin Resource Sharing) AJAX requests. This is a step toward web apps that directly talk to daemon nodes, which is a more decentralized model than the current web apps’ server client model. In this model, web apps can be open source and run from a local copy (to maximize user security), managing keys and signing, while communicating with the daemon node only public data.
Both peercoin and primecoin are supported.
Example using jQuery:
$.ajax({
...
type: "POST",
url: "http://daemonhost:rpcport/",
headers: {"Authorization": "Basic " + btoa("rpcuser:rpcpassword")},
contentType: "application/json",
data: JSON.stringify({
method: "getblock",
params: ["blockhash", true],
id: 0,
}),
...
});