Skip to content

Commit

Permalink
Merge 1a2efa4 into 97e8422
Browse files Browse the repository at this point in the history
  • Loading branch information
itsezc committed Jun 6, 2018
2 parents 97e8422 + 1a2efa4 commit 3c05489
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
@@ -1,6 +1,6 @@
# tcp-proxy.js

a simple tcp proxy
A TCP Proxy package for NodeJS

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
Expand All @@ -22,7 +22,7 @@ a simple tcp proxy
$ npm i tcp-proxy.js --save
```

create proxy
### Create a new proxy instance

```js
const TCPProxy = require('tcp-proxy.js');
Expand All @@ -33,13 +33,25 @@ proxy.createProxy({
});
```

end proxy
### Create a new proxy instance for a specific IP/Hostname
This will only listen to connections on the specified IP/Hostname, you can have duplicates of ports this way.

```js
const TCPProxy = require('tcp-proxy.js');
const proxy = new TCPProxy({ host: 'localhost', port: 9229 });
proxy.createProxy({
forwardPort: 9999,
forwardHost: 'localhost',
});
```

### End proxy

```js
proxy.end();
```

interceptor
### Interceptor

```js
proxy.createProxy({
Expand All @@ -61,7 +73,7 @@ proxy.createProxy({
});
```

async interceptor
### Async Interceptor

```js
proxy.createProxy({
Expand All @@ -83,4 +95,4 @@ proxy.createProxy({

## License

MIT
MIT

0 comments on commit 3c05489

Please sign in to comment.