Skip to content

Instantly share code, notes, and snippets.

@temsa
Created September 27, 2011 13:21
Show Gist options
  • Save temsa/1245022 to your computer and use it in GitHub Desktop.
Save temsa/1245022 to your computer and use it in GitHub Desktop.
Hook Gateway
$> hookio-repl --hook-host 127.0.0.2
$> hookio-repl --hook-host 127.0.0.1
var Hook = require('hook.io').Hook
var hook2 = new Hook({host:"127.0.0.1", name:'gateway'})
hook2.debug =true
hook2.connect()
hook.onAny(function(data, callback){hook2.emit(hook.event, data, callback)})
hook2.onAny(function(data, callback){console.log(hook2.event.split('::')[1], hook.name); /*hook.emit(hook2.event, data, callback)*/})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment