Last active
November 5, 2019 00:16
-
-
Save cloudonshore/1e77fb2e748c51fbd2c66f9eea4a5b2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ws = require("nodejs-websocket") | |
const options = { extraHeaders: { Authorization: 'Basic ' + Buffer.from('892bf962872d4f84b779fa893e138f7b').toString('base64') } } | |
const conn = ws.connect('wss://mainnet.infura.io/ws/v3/1fa032434d904e018fbbc138d3f6cb3c', options, () => { | |
console.log( 'we are connected now') | |
conn.on("text", function (str) { | |
console.log("Received "+str) | |
}) | |
conn.sendText('{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment