xmpp | Go XMPP | Messaging library
kandi X-RAY | xmpp Summary
kandi X-RAY | xmpp Summary
This is a fork of github.com/agl/xmpp modified for use by an XMPP server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main entry point
- Read implements io . Reader interface
- NewTLSStateMachine creates a new StateMachine
- NewConn returns a connection
- makeResource returns a random string
- createCookie creates a new random cookie
xmpp Key Features
xmpp Examples and Code Snippets
Community Discussions
Trending Discussions on xmpp
QUESTION
I'm trying to create a Chat application to enhance my portfolio. For it I'm using xmpp as my messaging server. So, I'm running ejabberd on kubernetes with the following configuration
...ANSWER
Answered 2022-Apr-01 at 13:22I know almost nothing about kubernetes and node.js, but I have experience in ejabberd and docker, so maybe I can give some useful hint:
Looking at the configuration you showed, and assuming you use the default ejabberd config from https://github.com/processone/docker-ejabberd/blob/master/ecs/conf/ejabberd.yml#L38
In that configuration file it says that:
- port 5222 is used for XMPP C2S connections
- 5280 for HTTP connections
- and 5443 is used for HTTPS, including WebSocket, BOSH, web admin...
service: "wss://ejabberd-srv:5222/xmpp-websocket",
In your case, if your client uses WebSocket to connect to ejabberd, you should open the 5443 port in kubernetes and tell your client to use an URL like "wss://ejabberd-srv:5443/ws",
QUESTION
On messaging from server to all active clients of one user the sender-address is not correctly written.
This is the broadcast-function (serverside):
...ANSWER
Answered 2021-Oct-15 at 15:51This is an error reply from the server, therefor it is the server who sends this message, not a specific user.
QUESTION
I'm connecting to an XMPP chat server using NetCoreServer. Everything is working as intended. Whenever the server sends a message I process it using a normal method processData(string data)
. The problem is that if the method takes longer than a specific amount of time, the server closes the connection.
I was thinking about executing the method asynchronously, but the problem is that messaging coming from the server could be split into parts. The method process data detects that, and if the message received is just one part of the entire message, it'll store it. Next time it's called appends the new message to the older one, checks if the new message completes it or if it needs to wait for the next message and so on, until it has a complete one. Then it'll continue with processing it, so if it's called asynchronously, the calls have to wait for previous ones before executing, without blocking the NetCoreServer's OnReceive.
I am thinking of adding a var task=new Task(() => { ProcessData(result); });
to a queue whenever new data from the server arrives, but I don't know how to chain their execution or how to proceed. Or I could store data in a queue as it arrives, and somehow trigger an event to call ProcessData
whenever a new message is added into the queue. But I'm having the same problem aside from not knowing how, that events triggered should wait for the previous ones completion.
ProcessData looks something like this:
...ANSWER
Answered 2022-Mar-02 at 07:19There are many tools that you could use for solving this problem. Here I'll show a TPL Dataflow solution. You will need two ActionBlock
s, one for joining the split parts of the messages, and one for processing the complete messages. I am writing them below in the reverse order, because the first block needs to know about the second block during its construction. This example assumes that the final part of each complete message ends with a dot character:
QUESTION
I recently tried binding based on RFC 6120 (9.1.3 pg 132) with:
...ANSWER
Answered 2022-Feb-28 at 04:01This appears to be a misunderstanding of how XML namespaces work. In one of your comments you suggested that you are using a namespace of jabber:socket
, but this is not a namespace that is defined anywhere in the XMPP specs and I could not find any reference to it online. Instead, you want to use jabber:client
(or jabber:server
if this were a server-to-server connection). A quick overview of XML namespaces is below:
All XML elements have a "name", this name is made of two parts: the local name and the namespace. The namespace is defined using an xmlns
attribute, for example the following are different elements, they do not have the same name:
QUESTION
After upgrading to android 12, the application is not compiling. It shows
"Manifest merger failed with multiple errors, see logs"
Error showing in Merged manifest:
Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for
android:exported
when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. main manifest (this file)
I have set all the activity with android:exported="false"
. But it is still showing this issue.
My manifest file:
...ANSWER
Answered 2021-Aug-04 at 09:18I'm not sure what you're using to code, but in order to set it in Android Studio, open the manifest of your project and under the "activity" section, put android:exported="true"(or false if that is what you prefer). I have attached an example.
QUESTION
I've found this: https://docs.ejabberd.im/admin/configuration/modules/#mod-muc
And this: https://docs.ejabberd.im/admin/ejabberdctl/muc-admin/#prerequisite
What are the steps I need to do to setup MUC from a fresh install? mod_muc is already in the ejabberd.yml file, and so is mod_muc_admin. I've also added myself as an admin.
Here is my ejabberd.yml file:
...ANSWER
Answered 2022-Feb-11 at 12:45What are the steps I need to do to setup MUC from a fresh install?
Usually mod_muc is already configured and enabled by default. Of course, if ejabberd is installed in a remote server, you will need to setup DNS for the MUC service, similar to what you may want to do for any other services that have their specific domain, like pubsub.example.org
QUESTION
While checking a port range on my nodes with following playbook extract,
...ANSWER
Answered 2022-Jan-24 at 14:50To allow Ansible to display values like new lines (\n
) and tabs (\t
), you can use the debug
callback.
This can be done, either modifying the ansible.cfg, if you want to apply it on your whole Ansible installation, e.g.
QUESTION
I am using xmpp.js library to create a simple XMPP client and Ejabberd server (ejabberd/ecs:latest- docker image). When I created MUC, it created successfully and I even received this success message from the server:
...ANSWER
Answered 2022-Jan-21 at 21:15First of all: you don't mention what version of ejabberd you are using. Maybe it's a bug fixed in a recent version?
You create a new room using your custom XMPP client. Why does the error message mention ejabberd_http
and ejabberd_web_admin
? Maybe that error message appears when you try to view the room details in the WebAdmin -> MUC page?
There's a {error, timeout}
that then triggers other errors. I guess only you know what's going on there... as this log mentions stuff that you have not mentioned.
Try creating the room using a well-known XMPP client, like Gajim or Psi. Does the WebAdmin page work correctly? Then the problem is somewhere in your client.
Create a room using a XMPP client, and another using your client. Then view the information stored in muc_online_room
mnesia table (WebAdmin -> Nodes -> your node -> Database. Do you see some weird difference?
Set persistent: true
create new rooms and check the content of muc_room
table. Some weird difference now?
QUESTION
I keep getting below error message while trying to run simple app on emulator and I can't figure out why. Any help would be really appreciated:
2022-01-19 21:00:38.935 13581-13581/com.thecircle.circle_beta E/AndroidRuntime: FATAL EXCEPTION: main Process: com.thecircle.circle_beta, PID: 13581 java.util.ServiceConfigurationError: org.jivesoftware.smack.xml.XmlPullParserFactory: Provider org.jivesoftware.smack.xml.stax.StaxXmlPullParserFactory could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:233) at java.util.ServiceLoader.access$100(ServiceLoader.java:183) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:392) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416) at java.util.ServiceLoader$1.next(ServiceLoader.java:494) at org.jivesoftware.smack.xml.SmackXmlParser.getXmlPullParserFactory(SmackXmlParser.java:44) at org.jivesoftware.smack.xml.SmackXmlParser.newXmlParser(SmackXmlParser.java:65) at org.jivesoftware.smack.util.PacketParserUtils.getParserFor(PacketParserUtils.java:80) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:159) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:154) at org.jivesoftware.smack.SmackInitialization.(SmackInitialization.java:103) at org.jivesoftware.smack.Smack.getVersion(Smack.java:38) at org.jivesoftware.smack.Smack.ensureInitialized(Smack.java:64) at org.jivesoftware.smack.ConnectionConfiguration.(ConnectionConfiguration.java:115) at org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration.builder(XMPPTCPConnectionConfiguration.java:64) at com.thecircle.circle_beta.xmpp.XMPPHandler.connect(XMPPHandler.java:30) at com.thecircle.circle_beta.PhoneNumberActivity.startXmppService(PhoneNumberActivity.java:62) at com.thecircle.circle_beta.PhoneNumberActivity.access$400(PhoneNumberActivity.java:27) at com.thecircle.circle_beta.PhoneNumberActivity$1.onClick(PhoneNumberActivity.java:53) at android.view.View.performClick(View.java:7448) at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1131) at android.view.View.performClickInternal(View.java:7425) at android.view.View.access$3600(View.java:810) at android.view.View$PerformClick.run(View.java:28305) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory; at org.jivesoftware.smack.xml.stax.StaxXmlPullParserFactory.(StaxXmlPullParserFactory.java:30) at java.lang.Class.newInstance(Native Method) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:388) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416) at java.util.ServiceLoader$1.next(ServiceLoader.java:494) at org.jivesoftware.smack.xml.SmackXmlParser.getXmlPullParserFactory(SmackXmlParser.java:44) at org.jivesoftware.smack.xml.SmackXmlParser.newXmlParser(SmackXmlParser.java:65) at org.jivesoftware.smack.util.PacketParserUtils.getParserFor(PacketParserUtils.java:80) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:159) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:154) at org.jivesoftware.smack.SmackInitialization.(SmackInitialization.java:103) at org.jivesoftware.smack.Smack.getVersion(Smack.java:38) at org.jivesoftware.smack.Smack.ensureInitialized(Smack.java:64) at org.jivesoftware.smack.ConnectionConfiguration.(ConnectionConfiguration.java:115) at org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration.builder(XMPPTCPConnectionConfiguration.java:64) at com.thecircle.circle_beta.xmpp.XMPPHandler.connect(XMPPHandler.java:30) at com.thecircle.circle_beta.PhoneNumberActivity.startXmppService(PhoneNumberActivity.java:62) at com.thecircle.circle_beta.PhoneNumberActivity.access$400(PhoneNumberActivity.java:27) at com.thecircle.circle_beta.PhoneNumberActivity$1.onClick(PhoneNumberActivity.java:53) at android.view.View.performClick(View.java:7448) at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1131) at android.view.View.performClickInternal(View.java:7425) at android.view.View.access$3600(View.java:810) at android.view.View$PerformClick.run(View.java:28305) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" on path: DexPathList[[zip file "/data/app/~~aqFATXxhdyAHQijKIOYWXw==/com.thecircle.circle_beta-k5LiJXZwDyvcFdkQlSjhkw==/base.apk"],nativeLibraryDirectories=[/data/app/~~aqFATXxhdyAHQijKIOYWXw==/com.thecircle.circle_beta-k5LiJXZwDyvcFdkQlSjhkw==/lib/x86_64, /system/lib64, /system_ext/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at org.jivesoftware.smack.xml.stax.StaxXmlPullParserFactory.(StaxXmlPullParserFactory.java:30) at java.lang.Class.newInstance(Native Method) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:388) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416) at java.util.ServiceLoader$1.next(ServiceLoader.java:494) at org.jivesoftware.smack.xml.SmackXmlParser.getXmlPullParserFactory(SmackXmlParser.java:44) at org.jivesoftware.smack.xml.SmackXmlParser.newXmlParser(SmackXmlParser.java:65) at org.jivesoftware.smack.util.PacketParserUtils.getParserFor(PacketParserUtils.java:80) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:159) at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:154) at org.jivesoftware.smack.SmackInitialization.(SmackInitialization.java:103) at org.jivesoftware.smack.Smack.getVersion(Smack.java:38) at org.jivesoftware.smack.Smack.ensureInitialized(Smack.java:64) at org.jivesoftware.smack.ConnectionConfiguration.(ConnectionConfiguration.java:115) at org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration.builder(XMPPTCPConnectionConfiguration.java:64) at com.thecircle.circle_beta.xmpp.XMPPHandler.connect(XMPPHandler.java:30) at com.thecircle.circle_beta.PhoneNumberActivity.startXmppService(PhoneNumberActivity.java:62) at com.thecircle.circle_beta.PhoneNumberActivity.access$400(PhoneNumberActivity.java:27) at com.thecircle.circle_beta.PhoneNumberActivity$1.onClick(PhoneNumberActivity.java:53) at android.view.View.performClick(View.java:7448) at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1131) at android.view.View.performClickInternal(View.java:7425) at android.view.View.access$3600(View.java:810) at android.view.View$PerformClick.run(View.java:28305) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I AM JUST RUNNING BELOW CODE:
...ANSWER
Answered 2022-Jan-19 at 14:59Your Smack dependency declarations are probably wrong, as smack-xmlparser-stax is not used on Android (because there is no StAX parser in Android). Instead use smack-xmlparser-xpp3 in Android, which is a dependency of smack-android.
QUESTION
Ejabberd newbie here. I hope this question makes sense.
We had a need to setup our own XMPP server so that customers on web and a Bria client can utilize it. I was able to get the basics up and running using ejabberd.
All users will be in the 'xmpp.exampledomain.com'
We also have a custom SMS gateway we built (which is really a server which can accept json APIs).
So what I am trying to accomplish:
- Our platform would create a 'normal' xmpp user so the user can login to ejabberd.
- This user can add roster contacts of other 'normal' xmpp users.
- If this user wants to send messages via SMS, we would instruct them to add roster contacts (i assume) with the format 12125551234@sms.exampledomain.com. (adding the contact works currently)
- If a user sends a message to this "SMS" contact, have ejabberd call our custom SMS gateway via a json API instead of attempting to deliver via normal xmpp.
Is this even possible?
For inbound from the SMS Gateway server, can call the ejabberd API send message function, so inbound is fairly easy.
I appreciate any suggestions
thanks
...ANSWER
Answered 2022-Jan-12 at 16:05What you want was called a "transport" in the old days of IRC, ICQ, AIM and MSN. They were programs that you installed next to ejabberd (or other Jabber servers). Example usage:
- you download a transport for ICQ
- configure it to have access to ICQ,
- and then configure ejabberd to connect to that transport, and allow users to contact it at address icq.example.com.
There are very old tutorials for your curiosity: https://www.ejabberd.im/tutorials-transports/index.html
I don't know if the old "SMS-Jabber transports" will work nowadays. Searching revelaed few results:
- https://www.jethrocarr.com/2013/06/03/smstoxmpp/
- https://sourceforge.net/projects/jabbersms/
- https://www.jabber.cz/wiki/SMS_transport
Alternatively, as you mentioned you already have a SMS program, if you can get your hands on Erlang or Elixir, you can write an ejabberd module that registers at sms.example.com, and forwards XMPP messages as json API...
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xmpp
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