lnd+lnrpc: enable WebSocket ping/pong messages

Fixes #4497 by sending out ping messages in a regular interval to make
sure the connection is still alive.
This commit is contained in:
Oliver Gugger
2021-04-27 15:47:32 +02:00
parent 5e7b905f19
commit 4b685e4d64
2 changed files with 82 additions and 2 deletions

3
lnd.go
View File

@@ -1266,7 +1266,8 @@ func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialO
// Wrap the default grpc-gateway handler with the WebSocket handler.
restHandler := lnrpc.NewWebSocketProxy(
mux, rpcsLog, lnrpc.LndClientStreamingURIs,
mux, rpcsLog, lnrpc.DefaultPingInterval, lnrpc.DefaultPongWait,
lnrpc.LndClientStreamingURIs,
)
// Use a WaitGroup so we can be sure the instructions on how to input the