您好,我正在创建一个用于通过smpp服务器发送SMS的简单Web API,我正在使用node-smpp(https://github.com/farhadi/node-smpp)连接到SMPP服务器。
问题是当smpp绑定到smpp服务器时,我无法访问在端口3000上监听的应用程序。
var smpp = require('smpp');
var http = require('http');
//create a server object:
http.createServer(function (req, res) {
res.write('Hello World!');
res.end();
}).listen(3000, function(){
console.log("server start at port 3000");
});
var session = new smpp.Session({host: 'localhost', port: 2775});
// We will track connection state for re-connecting
var didConnect = false;
session.on('connect', function(){
didConnect = true;
session.bind_transceiver({
system_id: 'smppclient1',
password: 'password'
}, function(pdu) {
console.log('pdu status', lookupPDUStatusKey(pdu.command_status));
if (pdu.command_status == 0) {
console.log('Successfully bound\n')
}
});
})