Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 1bd1289

Browse files
committed
Added example about connecting with auth and pass
1 parent 5453b9a commit 1bd1289

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

examples/connectauth.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
require_once __DIR__ . "/../vendor/autoload.php";
3+
4+
$connectionOptions = new \Nats\ConnectionOptions();
5+
$connectionOptions
6+
->setHost('localhost')
7+
->setPort(4222)
8+
->setUser("foo")
9+
->setPass("bar");
10+
$c = new Nats\Connection($connectionOptions);
11+
$c->connect();
12+
$c->close();

0 commit comments

Comments
 (0)