node: fix listening on IPv6 address (#27628) (#27635)

This commit is contained in:
Curith
2023-07-02 13:21:16 +02:00
committed by GitHub
parent 8bbb16b70e
commit 6ca3ef9a7b
5 changed files with 10 additions and 6 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import (
"fmt"
"io"
"math/big"
"net"
"os"
"os/signal"
"path/filepath"
@@ -743,7 +744,7 @@ func signer(c *cli.Context) error {
port := c.Int(rpcPortFlag.Name)
// start http server
httpEndpoint := fmt.Sprintf("%s:%d", c.String(utils.HTTPListenAddrFlag.Name), port)
httpEndpoint := net.JoinHostPort(c.String(utils.HTTPListenAddrFlag.Name), fmt.Sprintf("%d", port))
httpServer, addr, err := node.StartHTTPEndpoint(httpEndpoint, rpc.DefaultHTTPTimeouts, handler)
if err != nil {
utils.Fatalf("Could not start RPC api: %v", err)