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));
  • Are we suppoed to guess the contents of your contract_config.js and the value of process.argv[3]??? – goodvibration Jun 5 '19 at 7:37
  • The standard Infura web socket url 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. – Eddie Jun 5 '19 at 8:01
  • Ah forgot to search github. github.com/ethereum/web3.js/issues/1965#issuecomment-437269711 – Eddie Jun 5 '19 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.