xmpp.js | open technology for real-time communication | Runtime Evironment library
kandi X-RAY | xmpp.js Summary
kandi X-RAY | xmpp.js Summary
XMPP is an open technology for real-time communication, which powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data. xmpp.js is a JavaScript library for XMPP.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xmpp.js
xmpp.js Key Features
xmpp.js Examples and Code Snippets
Community Discussions
Trending Discussions on xmpp.js
QUESTION
I have one file which includes this string in it:
...ANSWER
Answered 2020-Dec-21 at 11:50You should use a proper json parser like jq for this but if you cannot use jq for some reason, you can use sed:
QUESTION
I have an electron app that creates a websocket connection to a node js server. It sends a JSON request to that server telling it to create a xmpp client.
...ANSWER
Answered 2020-May-26 at 10:23I had a constant outside the websocket connection, changed it to have a var inside so each connection had it own client.
QUESTION
I'm trying to run a test using a local xmpp server in the browser.
...ANSWER
Answered 2019-May-03 at 17:37Most likely you would have to change your service
URI - both protocol as well as port part. As per xmpp.js client documentation you should use:
QUESTION
I am using a combination of electron.js and xmpp.js in order to make my own client. My main project is consisted of these 2 files:
Boostrapping electron on: index.js
:
ANSWER
Answered 2018-Nov-23 at 20:29The @xmpp/client
library seems that lacks the api calls when connection error happens as seen in the following example:
QUESTION
I am using MongooseIM as chat server and connecting it over websocket using xmpp.js inside react-native application. The server forcefully closes the connection after 60s on inactivity. I want to know:
- If this is the default config?
- Should/Can I change it?
- Should I set up ping mechanism such that my client must send some pings after every 60s to avoid disconnect
ANSWER
Answered 2018-Nov-19 at 09:54WebSocket connections have default timeout value for inactivity set to infinity. Your configuration most probably contains "{timeout, 60000}" in the "mod_websockets" configuration. In order to keep idle connections connected to the server you can send WebSocket ping frames from time to time.
More info about "mod_websockets" configuration is here:: https://mongooseim.readthedocs.io/en/latest/advanced-configuration/Listener-modules/#http-based-services-bosh-websocket-rest-ejabberd_cowboy
You can even configure the server to send WebSocket's ping frames by specifying the option {ping_rate, ValueInMilliSeconds
}
QUESTION
I am using xmpp.js as xmpp chat client inside react-native for both android+ios with MongooseIM as chat server. I want to implement stream management acks in the App. But according to the issue#540, xmpp.js doesn't officially support stream management for now. What can be the alternate to this?
I need the stream management module only to send/receive acks between c2s and s2s. Please guide.
...ANSWER
Answered 2018-Nov-13 at 09:56Stream Management, if not available in your client library of choice, is somewhat complex to implement - though definitely would be welcome by the open source community ;)
XMPP Ping is a simpler alternative to detect broken connections. It's available in a range of servers including MongooseIM and ejabberd. The idea is that any side of the connection sends a ping IQ - since IQs are standardised to require responses, if a response does not come in a predefined time interval, you can assume such a connection is dead. There's no protocol for message retransmission like with Stream Management, but if you're running with Message Archive Management (mod_mam
) all the messages should be stored safely anyway.
Alternatively, as somebody has suggested in the issue you link, you could switch to Stanza.io which supports XEP-198.
QUESTION
I am using XMPP.js inside react native and using web socket to connect with the xmpp server. I can successfully connect with the chat server but I have to navigate to different pages inside the App so I have 2 options:
I must open a new XMPP connection to the xmpp chat server everytime I navigate to a new page (using react Navigation for navigating) and close the old connection [I think its not recommended] or
I must open the connection in the starting and use the same connection throughout the entire app. But how to achieve that?
Is there any alternative like services in react native with which I can open the XMPP connection in the backend and it must work throughout the entire app. I need the feasible solution for both Android+IOS
...ANSWER
Answered 2018-Nov-10 at 15:05You must open the connection in the starting and use the same connection throughout the entire app. You need to have some class like singleton or so which will hold an xmpp client, so you will use it across the entire app. Or you even can try to hold a global variable inside App.js with xmll client.
For example, here at ConnectyCube ReactNative SDK https://developers.connectycube.com/js/react-native there is a simple prototype object which holds an xmpp client. Then this object can be used in a flux container or as a global variable, something like here How to use global variables in React Native?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xmpp.js
component
xml
jid
time
uri
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page