"View on GitHub"></i></a><a class="toolbar-icons pull-right"><i class="mdi mdi-content-copy js-copy" title="Copy to Clipboard"></i></a><span class="copy-msg pull-right"></span><code class="language-python">nc = NATS()

async def disconnected_cb():
   print(&#34;Got disconnected!&#34;)

async def reconnected_cb():
   # See who we are connected to on reconnect.
   print(&#34;Got reconnected to {url}&#34;.format(url=nc.connected_url.netloc))

await nc.connect(
   servers=[&#34;nats://demo.nats.io:4222&#34;],
 