bud-backend
Example backend server for Bud
Last updated 6 years ago by indutny .
MIT · Original npm · Tarball · package.json
$ cnpm install bud-backend 
SYNC missed versions from official npm registry.

bud-backend

An example/template backend for bud.

Usage

CLI

$ npm install -g bud-backend
$ cat > config.json <<JSON
{
  "port": 9000,
  "host": "127.0.0.1",
  "sni": {
    "enabled": true,
    "store": {
      "example.com": {
        "cert": "keys/cert.pem",
        "key": "keys/key.pem"
      }
    }
  }
}
JSON
$ bud-backend --conf config.json

Module

var bud = require('bud-backend');

bud.createServer({
  // Server Name Indication configuration
  sni: {
    enabled: true,

    store: {},

    // *Optional* lookup function, if present - `store` may be omitted
    lookup: function (servername, callback) {
      callback(null, {
        cert: '-----BEGIN CERTIFICATE-----\n...',
        key: '-----BEGIN RSA PRIVATE KEY-----\n...',

        // Optional
        npn: [ ... ],
        ciphers: 'RSA-OMG-SECURE-128:RSA-OMG'
      });
    }
  },

  // OCSP Stapling cache configuration
  ocsp: {
    enabled: true,

    // Optional, filter OCSP urls
    filter: function (url, callback) {
      if (/* url is known and whitelisted */)
        callback(null);
      else
        callback(new Error('Url is not whitelisted'));
    },

    // Optional
    store: function (key, value, maxTime, callback) {
      // Should store `value` under the `key` with maximum TTL `maxTime`
      // (in milliseconds) in backend storage and invoke callback, once
      // ready.
    },

    // Optional, must be present if `store` is used
    probe: function (key, callback) {
      callback(null, data);
    }
  }
})

LICENSE

This software is licensed under the MIT License.

Copyright Fedor Indutny, 2013.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.8.0                                ...           latest (6 years ago)

16 Versions

  • 0.8.0                                ...           6 years ago
  • 0.7.0                                ...           6 years ago
  • 0.6.2                                ...           6 years ago
  • 0.6.1                                ...           6 years ago
  • 0.6.0                                ...           6 years ago
  • 0.5.1                                ...           6 years ago
  • 0.5.0                                ...           6 years ago
  • 0.4.1                                ...           7 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.2                                ...           7 years ago
  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |