Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,14 @@ Sample output:

### Example Usage

The following html page connects to the socket.io insight API and listens for new transactions.
The following html page connects to the socket.io insight API and listens for new InstantSend transactions.

```html
<html>
<body>
<script src="http://<insight-server>:<port>/socket.io/socket.io.js"></script>
<script>
eventToListenTo = 'tx'
eventToListenTo = 'txlock'
room = 'inv'

var socket = io("http://<insight-server>:<port>/");
Expand All @@ -825,11 +825,7 @@ The following html page connects to the socket.io insight API and listens for ne
socket.emit('subscribe', room);
})
socket.on(eventToListenTo, function(data) {
if (data.txlock) {
console.log("New InstantSend transaction received: " + data.txid)
} else {
console.log("New transaction received: " + data.txid)
}
console.log("New InstantSend transaction received: " + data.txid)
})
</script>
</body>
Expand Down