docs: update
This commit is contained in:
parent
e3472002e7
commit
1d096097d6
@ -114,8 +114,6 @@ class MyCustomPreset extends blinksocks.IPreset {
|
|||||||
module.exports = MyCustomPreset;
|
module.exports = MyCustomPreset;
|
||||||
```
|
```
|
||||||
|
|
||||||
All built-in actions are defined in `blinksocks.actions`.
|
|
||||||
|
|
||||||
> NOTE: `onNotified` is called **synchronous** when broadcast().
|
> NOTE: `onNotified` is called **synchronous** when broadcast().
|
||||||
|
|
||||||
### Handle Address
|
### Handle Address
|
||||||
@ -132,10 +130,9 @@ You are probably want to know the target host and port when write your own prese
|
|||||||
will be emitted once pipe created, you can access to it in `onNotified(action)` on client side or `broadcast(action)` it once decoded on server side:
|
will be emitted once pipe created, you can access to it in `onNotified(action)` on client side or `broadcast(action)` it once decoded on server side:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const blinksocks = require('blinksocks');
|
const {IPreset, CONNECT_TO_REMOTE} = require('blinksocks');
|
||||||
const {CONNECT_TO_REMOTE} = blinksocks.actions;
|
|
||||||
|
|
||||||
class MyCustomPreset extends blinksocks.IPreset {
|
class MyCustomPreset extends IPreset {
|
||||||
|
|
||||||
onNotified(action) {
|
onNotified(action) {
|
||||||
if (__IS_CLIENT__ && action.type === CONNECT_TO_REMOTE) {
|
if (__IS_CLIENT__ && action.type === CONNECT_TO_REMOTE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user