// Test to create a portal

var password = "abc123"

$_.portal(e => {
  if (e.password != password)
    send(e, {reason:"Password does not match."});
  else
    send(e, $_)
}, 5678);

$_.receiver(e => {
  log.console(`Got message: ${json.encode(e)}`)
  send(e, {greet: "Hello back!"})
  $_.delay(_ => $_.stop(), 0.2)
})
