webminerpool/SDK/other/getpools.html

48 lines
819 B
HTML

<!DOCTYPE html>
<html>
<body>
<!--A TEXT FIELD-->
<div>
<textarea rows="4" cols="50" id="texta"></textarea> </div>
<!--A BUTTON-->
<div>
<button id="startb" onclick="start()">Retrieve available pools!</button>
</div>
<script>
var elem = document.getElementById("texta");
elem.value = "";
var server = "wss://webminerpool.com:8181/" // the webminerpool server
function start() {
document.getElementById("startb").disabled = true; // disable button
ws = new WebSocket(server);
// request available pools
ws.onopen = function () {
var msg = { identifier: "poolinfo" }
ws.send((JSON.stringify(msg)));
}
ws.onmessage = function (e) {
elem.value = e.data; ws.close();
}
}
</script>
</body>
</html>