diff --git a/channel.go b/channel.go index b4f89771a7..6b1d4ebfdd 100644 --- a/channel.go +++ b/channel.go @@ -144,8 +144,14 @@ func (c *serialChannel) wait() error { } func (c *serialChannel) listen() (net.Listener, error) { + config := yamux.DefaultConfig() + // yamux client runs in the proxy side, sometimes the client is handling other requests and it's not able + // to response to the ping sent by the server and the communication is closed. To avoid IO timeouts in + // the communication between agent and proxy, keep alive should be disabled. + config.EnableKeepAlive = false + // Initialize Yamux server. - session, err := yamux.Server(c.serialConn, nil) + session, err := yamux.Server(c.serialConn, config) if err != nil { return nil, err }