-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@vates/nbd-client): use secure connect eve,t
- Loading branch information
1 parent
76bd00b
commit cc3f2c0
Showing
2 changed files
with
63 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
### `new NdbClient({address, exportname, secure = true, port = 10809})` | ||
|
||
create a new nbd client | ||
### `new NdbClient({address, exportname, secure = true, port = 10809})` | ||
|
||
create a new nbd client | ||
|
||
```js | ||
import NbdClient from '@vates/nbd-client' | ||
const client = new NbdClient({ | ||
address: 'MY_NBD_HOST', | ||
exportname: 'MY_SECRET_EXPORT', | ||
cert: 'Server certificate', // optional, will use encrypted link if provided | ||
}) | ||
|
||
import NbdClient from '@vates/nbd-client' | ||
const client = new NbdClient({ | ||
address: 'MY_NBD_HOST', | ||
exportname: 'MY_SECRET_EXPORT', | ||
cert: 'Server certificate', // optional, will use encrypted link if provided | ||
}) | ||
|
||
await client.connect() | ||
const block = await client.readBlock(blockIndex, BlockSize) | ||
await client.disconnect() | ||
|
||
await client.connect() | ||
const block = await client.readBlock(blockIndex, BlockSize) | ||
await client.disconnect() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters