1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | var Proxy = require('./lib/proxy')
|
7 |
|
8 | module.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 | }
|