How to subscribe smartcontract event in Harmony js-sdk?

const hmy = new Harmony(process.env.TESTNET_0_WSS,
{
        chainType: ChainType.Harmony,
        chainId: 2,
})
let instance = hmy.contracts.createContract(abi, address);
instance.events.Deposit()
.on('data', (event) => {
 console.log(event);
})
.on('error', console.error);

process.env.TESTNET_0_WSS=‘wss://ws.s0.b.hmny.io’
=> Always error invoked
Thank your times

Hey Hiro,

Just checked, there is some issue with the testnet ws endpoint. Will fix it as soon as possible and let you know. Sorry for the trouble.

@Hiro, the web socket testnet endpoint should be working now. please try and let us know if you have any further issues.