After a few hours the socket to Infura seems to drop and we get the error, Error: Connection error: Connection is not open on send()
Why does this happen or what is the best way to solve it?
version: 1.0.0-beta.52
This is how the app connects.
const contractConfig = require('./contract_config.js')
if (process.argv[3] == 'ropsten') {
var network = 'ropsten';
} else {
var network = 'main'
}
var web3 = new Web3(new Web3.providers.WebsocketProvider(contractConfig[network].url));
contract_config.js
and the value ofprocess.argv[3]
???wss://ropsten.infura.io/ws/v3/KEY
. It works for some hours before the error. Maybe this would be better posted in a github issue.