Already referred web3 documentations and other Q-A for web socket connection. Currently using infura as provider.
[Ethereum] How to connect with WebSocket with Web3
eventsinfuraweb3jswebsocket
eventsinfuraweb3jswebsocket
Already referred web3 documentations and other Q-A for web socket connection. Currently using infura as provider.
Best Answer
I think this is what you are looking for:
Replace the variables. Take note of the URL. Websocket URL is not only different by
wss
at the front.This code is tested and surely works.
EDIT: Please write why you downvote this answer! It is completely correct.