blinksocks / blinksocks

A framework for building composable proxy protocol stack.
Apache License 2.0
589 stars 79 forks source link

add an initial broadcast to all presets when pipeline created #85

Closed micooz closed 7 years ago

micooz commented 7 years ago

This allow presets to do initial work after constructor() but before xxxOut(In).

import {IPreset, PRESET_INIT} from './defs';

export default class CustomPreset extends IPreset {

  onNotified({type, payload: {broadcast}}) {
    if (type === PRESET_INIT) ...
  }

}