xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.19k stars 375 forks source link

in band registration Not working using node-xmpp #999

Closed Ali1Abbas closed 11 months ago

Ali1Abbas commented 11 months ago

Currently working on node-xmpp ejabberd server on aws i want to register user in band registration using node-xmpp module

this is my code that iam running

//Dependencies var xmpp = require('node-xmpp');

//Host configuration var host = "****"; var port = "**"; var admin = "admin@**m"; var adminPass = "**";

var connection = new xmpp.Client({ jid: admin, password: adminPass, host: host, port: port });

//user to be registered name & pass var newUserName = "pepe"; var newUserPass = "pepePass";

//Stream var iq = "" + newUserName + "" + newUserPass + ""; var result = "" //Send connection.send(iq); connection.send(result);

//End connection.end();

erorr i get :

node:events:491 throw er; // Unhandled 'error' event ^

Error: write EPIPE at afterWriteDispatched (node:internal/stream_base_commons:160:15) at writeGeneric (node:internal/stream_base_commons:151:3) at Socket._writeGeneric (node:net:923:11) at Socket._write (node:net:935:8) at writeOrBuffer (node:internal/streams/writable:392:12) at _write (node:internal/streams/writable:333:10) at Writable.write (node:internal/streams/writable:337:10) at Socket. (C:\Users\ZETTA\desktop\xmpp_node\node_modules\node-xmpp-core\lib\Connection.js:204:22) at socket.serializeStanza (C:\Users\ZETTA\desktop\xmpp_node\node_modules\node-xmpp-core\lib\Connection.js:170:9) at Connection.send (C:\Users\ZETTA\desktop\xmpp_node\node_modules\node-xmpp-core\lib\Connection.js:203:17) Emitted 'error' event on Client instance at: at Client. (C:\Users\ZETTA\desktop\xmpp_node\node_modules\node-xmpp-client\lib\Client.js:158:23) at Connection.emit (node:events:525:35) at Socket.onDisconnect (C:\Users\ZETTA\desktop\xmpp_node\node_modules\reconnect-core\index.js:59:17) at Socket.emit (node:events:525:35) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4047, code: 'EPIPE', syscall: 'write' }

your reply is highly appreciated it