Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[node-xmpp-bosh] no XHR info. #21

Open
ghost opened this issue Feb 17, 2014 · 11 comments
Open

[node-xmpp-bosh] no XHR info. #21

ghost opened this issue Feb 17, 2014 · 11 comments

Comments

@ghost
Copy link

ghost commented Feb 17, 2014

Hi

I'm trying to make it work but i can't.
I can connect my account with pidgin with my bosh server.

I configured converse but nothing happen with roundcube 0.9.5.It ask me to connect myself but when i click on log in it reload the page.

I don't have any XHR return.
There is my config :

$rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
        return 'http://mail.myserver.com:5280/http-bind';
        # return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);
        # return sprintf('http://%s/http-bind', $args['host']);
};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code),
// this can be a relative URL
$rcmail_config['converse_xmpp_bosh_url']= function($args) {
        return 'http://mail.myserver.com:5280/http-bind';
};

// Hostname portion of XMPP username (bare JID), example: "example.net"
$rcmail_config['converse_xmpp_hostname']= function($args) {
        return 'mail.myserver.com';
        # return preg_replace('/^.*@/', '', $args['user']);
        # return $args['host'];
};

// Username portion of XMPP username (bare JID), example: "user"
// if this contains @, this will only take the part before @,
// and the part after @ will replace the hostname definition above.
$rcmail_config['converse_xmpp_username']= function($args) {
        return $args['user'];
        # return preg_replace('/@.*$/', '', $args['user']);
};

// XMPP password
$rcmail_config['converse_xmpp_password']= function($args) {
        return $args['pass'];
};

Any ideas ?

@priyadi
Copy link
Owner

priyadi commented Mar 17, 2014

Hi, I'm sorry I missed this one.

You shouldn't use "http://mail.myserver.com:5280/http-bind" as converse_xmpp_bosh_url unless your Roundcube is running at http://mail.myserver.com:5280/, which I highly doubt. Instead, you should set up proxying. See this for more information: http://prosody.im/doc/setting_up_bosh

@brunohulk
Copy link

@kikadisa I've got the exactly same problem, what did you do to solve it?

@ghost
Copy link
Author

ghost commented Apr 23, 2014

Nothing i put my aim in standby. Don't have enough time to work on it.

@brunohulk
Copy link

@priyadi I saw your answer about my post in another thread (#23) tks for that, however I checked the log messages before and I didn't find any usefull information, my problem is the same that @kikadisa said above, "the reload problem", in my opinion is a front-end problem, because we don't receive any. answer from de server and the client don't send info to server.

Tks for your quick answer and attention.

@priyadi
Copy link
Owner

priyadi commented Apr 23, 2014

@brunohulk can you post your config?

@brunohulk
Copy link

Of course!

// $args['host'] : IMAP hostname
// $args['user'] : IMAP username
// $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP),
// this must be an absolute URL
$rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
        return 'http://192.168.254.102:5280/http-bind';
        # return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);
        # return sprintf('http://%s/http-bind', $args['host']);
};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code),
// this can be a relative URL
$rcmail_config['converse_xmpp_bosh_url']= function($args) {
        return 'http://192.168.254.102/http-bind';
};

// Hostname portion of XMPP username (bare JID), example: "example.net"
$rcmail_config['converse_xmpp_hostname']= function($args) {
        return 'brc.com.br';
        # return preg_replace('/^.*@/', '', $args['user']);
        # return $args['host'];
};

// Username portion of XMPP username (bare JID), example: "user"
// if this contains @, this will only take the part before @,
// and the part after @ will replace the hostname definition above.
$rcmail_config['converse_xmpp_username']= function($args) {
        return $args['user'];
        # return preg_replace('/@.*$/', '', $args['user']);
};

// XMPP password
$rcmail_config['converse_xmpp_password']= function($args) {
        return $args['pass'];
};

// Always embed chat even if prebinding is not configured or failed
$rcmail_config['converse_xmpp_enable_always'] = true;

// Enable debug mode
$rcmail_config['converse_xmpp_debug'] = true;

// Enable development mode
$rcmail_config['converse_xmpp_devel_mode'] = false;

// Use older XMPP bind code (in case someone is having problem with
// newer code using Candy Chat's prebind library)
$rcmail_config['converse_xmpp_old_style_prebind'] = true;

// Configure XMPP resource prefix. XMPP resource is set to this variable
// appended with a unique id. Defaults to 'Roundcube-'.
$rcmail_config['converse_xmpp_resource_prefix'] = 'Roundcube-';

I found one thing in the XMPP debug, but it is working on PIDGIN:

[23-Apr-2014 15:28:32 -0300]: C: <?xml version="1.0"?>
<body xmlns="http://jabber.org/protocol/httpbind" rid="250379815" to="brc.com.br" sid="0e51458707fe0d6ee33548f32b7018b7c"><auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">BASE64_CODE_USER__PASS_REPLACED_BY_ME</auth></body>

[23-Apr-2014 15:28:32 -0300]: S: <body xmlns='http://jabber.org/protocol/httpbind'><failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><malformed-request/></failure></body>

@priyadi
Copy link
Owner

priyadi commented Apr 23, 2014

@brunohulk

Did you paste the XMPP debug correctly? or did github eat your comment?

Try verifying BOSH endpoint from the server hosting your Roundcube: curl http://192.168.254.102:5280/http-bind, see if it can connect without problem. Also, verify if php-curl is installed.

@brunohulk
Copy link

I fixed the post @priyadi, It was missing a piece
About your request, both are right, because I am using in Pidgin and in a stand alone Converse installation, about curl, yes, it does.

@priyadi
Copy link
Owner

priyadi commented Apr 23, 2014

@brunohulk

Pidgin and Converse stand alone doesn't do prebinding. I guess the problem might be in prebind code. Please see your XMPP server log files to see if your Roundcube at least made a connection.

I'll have to go sleep now. I'll continue this tomorrow. It would be very helpful if you can provide me access to your server. If error message doesn't appear anywhere, some close debugging will be required.

@mckaygerhard
Copy link

hi @priyadi i have same problem, see in my config have the url with prot include, remove it and re-try, paste results in #24 and this are same as #23 but i repeat here, tell me what can i help i know something of php.. not much , how can i help?

my xmpp server are ejabberd 2.1.13 with some patches backported form upstream, property working, tested the url bosh with pidgin and work

http server are lighttpd 1.4.35 working perfectly, i see some tip, when i requested the bind http server show nothing, but calling explicy by using port in url show the ejabberd notice about working..

follow instruction in troubleshooting and here my paste:

Request URL:https://dmoain.net/http-bind
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:es-419,es;q=0.8
Connection:keep-alive
Content-Length:210
Content-Type:application/xml
Cookie:TRACKID=6517ec3e9a436ed0ae04dd2d2c02cd9c; roundcube_sessid=5pkpk5qms2jn4e2oq5kgajv9t3; roundcube_sessauth=S60f463951195f413b8e4314d93a7650fb964f37a
Host:domain.net
Origin:https://domain.net.ve
Referer:https://domain.net.ve/roundcube/?_task=mail
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
Request Payload
<body rid='2672132707' xmlns='http://jabber.org/protocol/httpbind' to='mckaygerhard' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>
Response Headersview source
Content-Length:0
Date:Mon, 26 May 2014 19:44:28 GMT
Server:lighttpd/1.4.35

the configuration file:

$rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
    return 'http://domain.net/http-bind';
};
$rcmail_config['converse_xmpp_bosh_url']= function($args) {
    return '/http-bind';
};
$rcmail_config['converse_xmpp_hostname']= function($args) {
    return 'domain.net';
};
$rcmail_config['converse_xmpp_username']= function($args) {
    return preg_replace('/@.*$/', '', $args['user']);
};
$rcmail_config['converse_xmpp_password']= function($args) {
    return $args['pass'];
};
$rcmail_config['converse_xmpp_enable_always'] = true;

i install a DNS for resolve "domain.net" and set all my clients to resolve trought this DNS so "domain.net" are not problem

what can i doing to help and make it work! i see some of code but uses 3 proyects (candy chat, php xmpp lib and other ), i really need that chat working in my rouncube

@mckaygerhard
Copy link

hi @priyadi i found that under certanly circunstances there some problems with XMPP server and bosh proxy url, but not related with converse.js its a limitation of xmmp sever and webserver instegration:

if server has own ssl cert and we configured xmpp server with ssl, some conflicts appears, so i disabled all ssl certs and all get to work, later enable ssl cert only in webserver and not in xmpp server, due proxy bosh url aleady will have ssl (u can made a redirect forcing for all bosh urls or rewrite rule)

now usinhg roundcube 1.X beta have some problem with stanza an presense..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants