I'm having the same issue as:
https://stackoverflow.com/questions/48744861/php-nats-client-disconnects-after-some-idle-time
After connecting, receiving few messages and having some 30 secs idle time, it gets disconnect itself without any interruption. However my Node.js client is working good with the same NATS server.
Not sure what I'm missing.