jabber implementation

825 views
Skip to first unread message

Amitabh Arya

unread,
May 3, 2012, 2:36:43 PM5/3/12
to golan...@googlegroups.com
Hi,

           Can we use https://github.com/mattn/go-xmpp to create ejabbered client not gtalk client? Incase yes then what we need to modify.

wkharold

unread,
May 3, 2012, 2:50:35 PM5/3/12
to golan...@googlegroups.com
Glancing at the example code it looks like you just pass the FQDN:port of your ejabbered server to xmpp.NewClient().

David Noelte

unread,
May 3, 2012, 2:43:46 PM5/3/12
to Amitabh Arya, golan...@googlegroups.com
I dont think this go-xmpp is limited to google talk only as it is just an example. if you look through the code check where gtalk stuff is hardcoded and replace it with your requirements.
at the end gtalk is only a jabber service too. cause you can use any standard xmpp client to connect to gtalk. 

dave

Amitabh Arya

unread,
May 3, 2012, 3:12:55 PM5/3/12
to wkharold, golan...@googlegroups.com
there is no  gtalk stuff hard coded except server and I tried after changing it. But there is not working, and there is no way to connect to particular room and get the chat.

Thanks,
Amitabh Arya

David Noelte

unread,
May 3, 2012, 3:25:43 PM5/3/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
I am just trying to get it working on a openfire server .... give me a moment

dave

Amitabh Arya

unread,
May 3, 2012, 3:36:42 PM5/3/12
to David Noelte, wkharold, golan...@googlegroups.com
sure, is there any problem using this API on windows and do I need to set any environment variable "HTTP_PROXY" to make it work if yes then what should be the value of that.

Thanks,
Amitabh Arya

David Noelte

unread,
May 3, 2012, 3:40:37 PM5/3/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
I havent used go-xmpp neither till now :-)
I am testing it on windows 7 and arch linux atm I will give you some feedback soon but give me a few minutes :-)

David Noelte

unread,
May 3, 2012, 4:47:58 PM5/3/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
with go-xmpp came an example.go file, did you see that?
I changed the server to localhost:5222 (which is running a ejabberd locally for testing) and in the ejabberd log I got a connection OK
the example.go through out an record overflow (which I have to look in to) but you can connect to a different server with the go-xmpp.

if you got any further question let me know

dave

David Noelte

unread,
May 3, 2012, 5:23:25 PM5/3/12
to golan...@googlegroups.com


On 3 May 2012 23:22, David Noelte <dno...@googlemail.com> wrote:
 I think as far as I have thought about it (i just had dinner beside that) that "record overflow" is thrown by tls package and I think you dont have TLS enabled on your ejabberd.
I didnt enable it on the test ejabberd here but I will in a second and try it again. 
So I think the error message is justs misleading and it could be just the fact that TLS is not enabled on the ejabberd.
cause I had a look into the go-xmpp and it always uses tls to connect to the xmpp.

let me get that tested first just to make sure and then ill tell you something about the channels.

dave

On 3 May 2012 23:16, Amitabh Arya <amitab...@gmail.com> wrote:
Hi David,

                 Yeah I am having same message " record overflow" issue and then application exit, as it's a fatal error. So, application is not working. The other thing, I am not able to figure out how to connect with a particular room in jabber. I am also using ejabbered server.

Please let me know if you will find the fix for it.

Thanks,
Amitabh Arya



On Thu, May 3, 2012 at 4:49 PM, David Noelte <dno...@googlemail.com> wrote:
you can also reach me via irc on #go-nuts@freenode :-)

David Noelte

unread,
May 3, 2012, 6:20:57 PM5/3/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
ah well I enabled tls and tested it on my ejabberd with pidgin client it all works fine but I am still getting the record overflow. I am looking into this now with gdb to find the issue.
I also made a fork of go-xmpp so if there is any changes to it i will push it in there


and i will send an update here if there is any news.

dave

On 3 May 2012 23:22, David Noelte <dno...@googlemail.com> wrote:
 I think as far as I have thought about it (i just had dinner beside that) that "record overflow" is thrown by tls package and I think you dont have TLS enabled on your ejabberd.
I didnt enable it on the test ejabberd here but I will in a second and try it again. 
So I think the error message is justs misleading and it could be just the fact that TLS is not enabled on the ejabberd.
cause I had a look into the go-xmpp and it always uses tls to connect to the xmpp.

let me get that tested first just to make sure and then ill tell you something about the channels.

dave

On 3 May 2012 23:16, Amitabh Arya <amitab...@gmail.com> wrote:
Hi David,

                 Yeah I am having same message " record overflow" issue and then application exit, as it's a fatal error. So, application is not working. The other thing, I am not able to figure out how to connect with a particular room in jabber. I am also using ejabbered server.

Please let me know if you will find the fix for it.

Thanks,
Amitabh Arya



On Thu, May 3, 2012 at 4:49 PM, David Noelte <dno...@googlemail.com> wrote:
you can also reach me via irc on #go-nuts@freenode :-)
On 3 May 2012 22:47, David Noelte <dno...@googlemail.com> wrote:

David Noelte

unread,
May 3, 2012, 7:15:32 PM5/3/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
Alright i put the error a little more into the corner ... 
when xmpp.go does the tls handshake it failes ...

line 95

        tlsconn := tls.Client(c, &DefaultConfig)
        if err = tlsconn.Handshake(); err != nil {
                return nil, err
        }


there it failes

David Noelte

unread,
May 4, 2012, 7:32:03 AM5/4/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
here is a little update. I am working on an own fork know to make it fully xmpp RFC compliant and not gtalk specific.

i have found a few infos about this package too which makes it look a little incomplite etc

from the github/issue  https://github.com/mattn/go-xmpp/pull/6 
"proof of concept for gtalk not all XMPP"

also from the xmpp.go it says 

"// Package xmpp implements a simple Google Talk client"

and i also found somoe infos on the googlegroups


where gary put in some infos about the xmpp package

"The package uses Google Talk features that are not specified by XMPP
RFCs. The package is also incomplete.

I think it will be more efficient to work through the XMPP RFCs offline
than to work through the issues in a code review.

Here are some issues that I noticed in the most recent version of the
code:"....


as soon as its finished i will write it here

Amitabh Arya

unread,
May 4, 2012, 1:30:07 PM5/4/12
to David Noelte, wkharold, golan...@googlegroups.com
Yeah sure, thanks Dave, I also tried to find out the issue,..  You may like to see this, in os.Getenv("HTTP_PROXY") code we are getting blank string. which actually stopping the code I guess.

let me know incase I can help you in this any how.

Thanks,
Amitabh Arya

Amitabh Arya

unread,
May 7, 2012, 12:05:31 PM5/7/12
to David Noelte, wkharold, golan...@googlegroups.com
Hi David,

                    Any progress in this, if you are not working on it. I can work on this, just let me know who can we connect and get/send message from jabber using socket conn and I am ready to write the code and add the code in github.

Thanks,
Amitabh Arya

David Noelte

unread,
May 7, 2012, 2:39:50 PM5/7/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
Hey,

sorry I am kinda busy with a customer project atm. So go ahead and add what ever you got. I made myself a todo list with some changes but wont be able to work on it till this weekend.
I am watch the repo so Ill get updates on that. if you need any testing let me know.

dave

Amitabh Arya

unread,
May 7, 2012, 2:55:32 PM5/7/12
to David Noelte, wkharold, golan...@googlegroups.com
yeah, but I don't have idea about Jabber how it connect, it's initial params and how I will get or send the message and all. If you have that idea or any better doc then please share with me. Otherwise I need to give my time to read that first and then I will code it.

Thanks,
Amitabh Arya

David Noelte

unread,
May 7, 2012, 3:15:45 PM5/7/12
to Amitabh Arya, wkharold, golan...@googlegroups.com
check the xmpp RFC's there is a lot of information about xml etc 
I wont be able to hand you over my knowledge just by mail :-) 



maybe this will keep you goin 

dave

Amitabh Arya

unread,
May 7, 2012, 3:32:18 PM5/7/12
to David Noelte, wkharold, golan...@googlegroups.com
cool :) great thanks

Thanks,
Amitabh Arya
Reply all
Reply to author
Forward
0 new messages