• Jump To … +
    chaperon.js colleague.bin.js colleague.js http.js ipc.js listener.js middleware.js network.js ua.js
  • ua.js

  • ¶
    var cadence = require('cadence')
    var util = require('util')
    var assert = require('assert')
    
    function UserAgent (ua) {
        this._ua = ua
    }
    
    UserAgent.prototype.send = cadence(function (async, properties, body) {
        var url = util.format('http://%s/kibitz', properties.location)
        this._ua.fetch({ url: url, post: {
            islandName: properties.islandName,
            colleagueId: properties.colleagueId,
            kibitz: body
        }, nullify: true }, async())
    })
    
    module.exports = UserAgent