Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nomilous committed Oct 20, 2016
1 parent 259ddd1 commit d875e3e
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A server and socket for [vertex](https://github.com/nomilous/vertex).

Uses [ws](https://www.npmjs.com/package/ws) underneath. They suggest installing binary addons for speed: [bufferutil](https://www.npmjs.com/package/bufferutil) and [utf-8-validate](https://www.npmjs.com/package/utf-8-validate)


<br />

### Quick Start

Expand All @@ -25,19 +25,26 @@ const {VertexServer, VertexSocket} = require('vertex-transport');
[details](#server-details)

```javascript
VertexServer.create()
VertexServer.listen()
.then(server => {})
.catch(error => {});
```

#### Start the client
#### Connect a client

[details](#client-details)

```
```javascript
VertexSocket.connect()
.then(socket => {})
.catch(error => {});

// result on the server
server.on('connection', socket => {});
```

<br />

### Errors

In addition to regular socket errors.
Expand All @@ -53,6 +60,8 @@ const {
} = require('vertex-transport').errors;
```

<br />

**Emitted** in the socket error event handler.

```javascript
Expand All @@ -65,6 +74,8 @@ vertexSocket.on('error', error => {});
vertexSocket.send({data: 1}).catch(error => {})
```

<br />

#### VertexSocketDataError

* **Emitted** on the server-side socket (usually when an attacker is probing the server port).
Expand Down Expand Up @@ -94,13 +105,17 @@ The socket is immediately closed.

* **Passed** in the `send()` promise rejection when the remote side assembled a response (ACK+data) that could not be encoded. This will usually only be encountered while developing.


<br />

### Server Details







<br />

### Client Details

0 comments on commit d875e3e

Please sign in to comment.