Reputation: 1812
I follow guide from Pusher JS is not working from node JS in some network to set proxy in my code. However, it shows error in my terminal.
The following is my code to add proxy server.
var Pusher = require("pusher");
var pusher = new Pusher({
appId: config.app_id,
key: config.key,
secret: config.secret,
proxy: 'http://username:password@proxynework:ppr\#',
timeout: TIMEOUT,
keepAlive: KEEP_ALIVE
});
Upvotes: 0
Views: 363
Reputation: 1228
The problem is that the variable TIMEOUT
hasn't been set anywhere (you'll have the same issue with KEEP_ALIVE
too). You've got a couple of options to resolve this:
1) set the timeout and keepAlive
//...
proxy: 'http://username:password@proxynework:ppr\#',
timeout: 2000,
keepAlive: false
2) leave them out (they're optional)
// ...
proxy: 'http://username:password@proxynework:ppr\#'
// use default timeout and keepalive values
});
Upvotes: 2