OpenZiti SDK for Node.js
- @openziti/ziti-sdk-nodejs
- ~close(conn) ⇒
void - ~dial(serviceName, isWebSocket, onConnect, onData) ⇒
void - ~express(express, serviceName) ⇒
* - ~httpRequest(serviceName, schemeHostPort, method, path, headers, onRequest, onResponse, onResponseData) ⇒
void - ~httpRequestData(req, data, onRequestData) ⇒
void - ~httpRequestEnd(req) ⇒
void - ~init(identityPath) ⇒
number - ~setLogLevel(level) ⇒
void - ~serviceAvailable(serviceName, onServiceAvailable) ⇒
void - ~write(conn, data, onWrite) ⇒
void - ~onDataCallback :
function - ~onConnectCallback ⇒
void - ~onRequestCallback ⇒
void - ~onResonseCallback ⇒
void - ~onResonseDataCallback ⇒
void - ~onRequestDataCallback ⇒
void - ~onServiceAvailableCallback ⇒
void - ~onWriteCallback ⇒
void
- ~close(conn) ⇒
Close a Ziti connection.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| conn | number |
A Ziti connection handle. |
Create a connection to Ziti Service.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| serviceName | string |
The name of the Ziti Service to connect to |
| isWebSocket | boolean |
True or False indicator concerning whether this connection if bi-directional. |
| onConnect | onConnectCallback |
The callback that receives the connection handle. |
| onData | onDataCallback |
The callback that receives incoming data from the connection. |
Wrap ExpressJS to facilitate hosting (listening) on a Ziti Service instead of a TCP port.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: * - The wrapped express() object.
| Param | Type | Description |
|---|---|---|
| express | * |
The express() object. |
| serviceName | string |
The name of the Ziti Service being served (hosted). |
@openziti/ziti-sdk-nodejs~httpRequest(serviceName, schemeHostPort, method, path, headers, onRequest, onResponse, onResponseData) ⇒ void
Initiate an HTTP request to a Ziti Service.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| serviceName | string |
The name of the Ziti Service to send the request. (mutually exclusive with url) |
| schemeHostPort | string |
The scheme/host/port (e.g. http://myserver.ziti:8080) of a Ziti service-config/intercept to send the request. (mutually exclusive with serviceName) |
| method | string |
The REST verb to use (e.g. GET, POST). |
| path | string |
The URL PATH to use on the request (can include HTTP query parms). |
| headers | Array.<string> |
The HTTP Headers to use on the request. |
| onRequest | onRequestCallback |
The callback that receives the request handle. |
| onResponse | onResonseCallback |
The callback that receives the HTTP Response. |
| onResponseData | onResonseDataCallback |
The callback that receives the HTTP Response data. |
Send payload data for HTTP POST request to a Ziti Service.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| req | number |
A Ziti HttpRequest handle. |
| data | Buffer |
The HTTP payload data to send. |
| onRequestData | onRequestDataCallback |
The callback that acknowleges the send. |
Terminate payload data transmission for HTTP POST request to a Ziti Service.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| req | number |
A Ziti HttpRequest handle. |
Initialize the Ziti session and authenticate with control plane.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: number - A status value ranging from 0 to 255.
| Param | Type | Description |
|---|---|---|
| identityPath | string |
File system path to the identity file. |
Set the logging level.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| level | number |
0=NONE, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=TRACE |
Set the logging level.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| serviceName | string |
The name of the Ziti Service being queried. |
| onServiceAvailable | onServiceAvailableCallback |
The callback that returns results of the query. |
write data to a Ziti connection.
Kind: inner method of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| conn | number |
A Ziti connection handle. |
| data | Buffer |
The data to send. |
| onWrite | onWriteCallback |
The callback that returns status of the write. |
This callback is part of the dial API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
| Param | Type | Description |
|---|---|---|
| conn | number |
A Ziti connection handle. |
This callback is part of the dial API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| data | Buffer |
Incoming data from the Ziti connection. |
This callback is part of the httpRequest API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Type | Description |
|---|---|---|
| req | number |
A Ziti HttpRequest handle. |
This callback is part of the httpRequest API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Description |
|---|---|
| resp | Incoming response from the HTTP request. |
| resp.req | The request handle. |
| resp.code | The HTTP status code. |
| resp.headers | The HTTP Headers on the response. |
This callback is part of the httpRequest API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Description |
|---|---|
| respData | Incoming response data from the HTTP request. |
| respData.req | The request handle. |
| respData.len | The length of the response body. |
| respData.body | The response body. |
This callback is part of the httpRequestData API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Description |
|---|---|
| reqData | Incoming status data from the HTTP request. |
| respData.req | The request handle. |
| respData.status | positive value indicates successful transmit. |
This callback is part of the serviceAvailable API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Description |
|---|---|
| availability | results of the query. |
| availability.status | 0 means available and OK, <0 means unavailable |
| availability.permissions | 1 means the identity can dial, 2 means the identity can bind |
This callback is part of the write API.
Kind: inner typedef of @openziti/ziti-sdk-nodejs
Returns: void - No return value.
| Param | Description |
|---|---|
| status | 0 means success, <0 means failure. |