// Token in URL
nc, err := nats.Connect("mytoken@localhost")
if err != nil {
log.Fatal(err)
}
defer nc.Close()
// Do something with the connection
Connection nc = Nats.connect("nats://mytoken@localhost:4222");//Token in URL
// Do something with the connection
nc.close();
let url = `nats://mytoken!@127.0.0.1:${port}`;
let nc = NATS.connect({url: url});
nc = NATS()
await nc.connect(servers=["nats://mytoken@demo.nats.io:4222"])
# Do something with the connection.
NATS.start("deadbeef@127.0.0.1:4222") do |nc|
puts "Connected using token!"
end
let url = `nats://:mytoken!@127.0.0.1:${port}`;
let nc = await connect({url: url});