UNPKG

751 BJavaScriptView Raw
1/*
2 * Copyright (c) 2015 by Greg Reimer <gregreimer@gmail.com>
3 * MIT License. See mit-license.txt for more info.
4 */
5
6var Proxy = require('./lib/proxy')
7
8module.exports = {
9 Proxy: Proxy,
10 createServer: function(opts) {
11 return new Proxy(opts)
12 },
13 forever: function(handler, ctx) {
14 console.error('warning: the forever() function is deprecated and will go away in a future release')
15 process.on('uncaughtException', function(err) {
16 if (handler === undefined) {
17 console.log(err.stack)
18 } else if (typeof handler === 'function') {
19 handler.call(ctx, err)
20 } else if (typeof handler.write === 'function') {
21 handler.write(err.stack)
22 } else {
23 console.log(err.stack)
24 }
25 })
26 },
27}