Moralis websocket keep disconnecting using ethersjs

hi, im a new forum user

const ethers = require("ethers")
const prov = new ethers.providers.WebSocketProvider( // my wss url
/* code...
const ws = prov._websocket

ws.on("open", () => console.log("connected"))
ws.on("close", () => console.log("disconnected")) // keep firing every 10 to 20 seconds

i’ve tried looping when it’s closed, but it returns 429 everytime (too much req)
nodejs version: v16
ethers version: 5.6.8

What type of requests you make to get that 429 rate limit error?

You may get disconnected from time to time. You can try a different node provider, try to reconnect automatically.