Node cannot be connected

I use WSS subscription and cannot connect

dial tcp 128.242.245.244:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I try to change the node to solve the problem, but there are still problems

Hey @1722512185

Thanks for reaching out to the Infura Community. Could you please share a bit more insight into what code you are using and sharing a repo if you have one, which node are you referring to, which network you are trying to connect to? If you have any additional screenshots or error logs that would also help.

Kind regards,
Alex | Infura Support | Consensys

func TestXxx(*testing.T) {

	client, err := ethclient.Dial("https://mainnet.infura.io/v3/3aaed553a64445c58fc21c3f01d69286")
	if err != nil {
		log.Fatal("connect error: ", err)
	}
	defer client.Close()

	account := common.HexToAddress("0x662892d7B6F58156a652050a169bEE985d989F4D")
	balance, err := client.BalanceAt(context.Background(), account, nil)
	if err != nil {
		log.Fatal("get balance error: ", err)
	}
	log.Println(balance)
}

I tried to get the account balance using the infura node

But I got an unexpected error (In the past, I can use the infra node normally)

=== RUN   TestXxx
2022/08/13 12:29:53 get balance error: Post "https://mainnet.infura.io/v3/3aaed553a64445c58fc21c3f01d69286": dial tcp 104.244.46.63:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
exit status 1
FAIL    go_eth  21.723s

I looked for other nodes to replace infura

func TestXxx(*testing.T) {

	client, err := ethclient.Dial("https://rpc.ankr.com/eth")
	if err != nil {
		log.Fatal("connect error: ", err)
	}
	defer client.Close()

	account := common.HexToAddress("0x662892d7B6F58156a652050a169bEE985d989F4D")
	balance, err := client.BalanceAt(context.Background(), account, nil)
	if err != nil {
		log.Fatal("get balance error: ", err)
	}
	log.Println(balance)
}
=== RUN   TestXxx
2022/08/13 12:31:48 62478413300645146
--- PASS: TestXxx (0.88s)

Meet expectations

Hey, which location are you trying to connect from ?