Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node agent/_header.js #28

Open
davidoresic opened this issue Mar 6, 2015 · 1 comment
Open

node agent/_header.js #28

davidoresic opened this issue Mar 6, 2015 · 1 comment

Comments

@davidoresic
Copy link

Hi

I have a problem whit _header.js.

I have build an push server that works nice on my local developer env. But once I try to run it on server in DMZ ports opened are (2195,2196,80) if I run node agent/_header.js it doesn't connect and I dont get any error as well ?

this is from console on my Developer PC
D:\lpns>node agent/_header.js
apnagent [sandbox] gateway connected

if I do it the same way on the server I get nothing :(

PS C:\lpns\lpns> node agent/_header.js
PS C:\lpns\lpns>

What can be a issue ?

@davidoresic
Copy link
Author

this is the header.js content

// location of app certificate
var join = require('path').join, pfx = join(__dirname, '../_certs/pfx.p12');
var config = require('../Config/configuration');
var apnagent = require('apnagent'), agent = module.exports = new apnagent.Agent();

agent.set('pfx file', pfx);
agent.set(config.CertUserName, config.CertPassword);
agent.enable('sandbox');

agent.connect(function (err) {
// gracefully handle auth problems
if (err && err.name === 'GatewayAuthorizationError') {
console.log('Authentication Error: %s', err.message);
process.exit(1);
} else if (err) {
console.log(err.message);
}

// it worked!
var env = agent.enabled('sandbox')
  ? 'sandbox'
  : 'production';

console.log('apnagent [%s] gateway connected', env);

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant