question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with keepalive, websockets and prebind

See original GitHub issue

Hi everyone,

Here are the software I am using conversejs 6.0.1 ejabberd 20.04 ubuntu 18.04

I load the js script this way. <script src="https://cdn.conversejs.org/6.0.1/dist/converse.min.js"></script>

  1. Websockets issue
        authentication: 'login',
	credentials_url: credentials_url,
	websocket_url: websocket_url_secure,
	jid: user_jid,
	password: user_jid_pass,
	enable_smacks: true,
	auto_login: true,
	keepalive: true,
	auto_reconnect: true,

When I activate the websocket, everything works as expected. But I have some problems with keepalive. For each request on my website (when a new page loads), a new authentication request is sent to the ejabberd server. So for every request there is a reconnection between converse.js and ejabberd. The session is therefore not kept alive when pages are loaded. How can I overcome this problem. With such behavior my app is not usable.

Here is the error I got in my javascript console.

ERROR: Websocket closed unexpectedly log.js:64:19
    log log.js:64
    error log.js:81
    error converse-core.js:822
    _onClose websocket.js:352
  1. prebind

I have tried to overcome above issue by using prebind authentication.

        authentication: 'prebind',
        prebind_url: prebind_url,
        bosh_service_url: bosh_service_url,

	enable_smacks: true,
	auto_login: true,
	keepalive: true,
	auto_reconnect: true,

But after enabling prebind authentication, I have the following error in my javascript console. (debug mode enable)

Uncaught (in promise) TypeError: this.model.vcard is undefined
    toHTML converse-profile.js:241
    render Backbone
    initialize converse-profile.js:313
ERROR: null 4 log.js:64:19
    log log.js:64
    error log.js:81
    queryInfo converse-disco.js:151
Uncaught (in promise) Error: A "url" property or function must be specified
    Backbone 2
    result Lodash
    Backbone 4
    update converse-vcard.js:352
ERROR: fetchFromServer@https://cdn.conversejs.org/6.0.1/dist/converse.min.js:158:66027
log.js:64:19
    log log.js:64
    error log.js:81
    populateRoster converse-roster.js:115

Regards

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
licaon-ktercommented, Jul 16, 2020

Can you retry with HEAD?

0reactions
jcbrandcommented, Jul 17, 2020

Ok, sorry, I misunderstood.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reconnection and KeepAlive #767 - websockets/ws - GitHub
To do this the biggest challenge I am facing is that neither the close event is called, not are my sends failing, neither...
Read more >
c# - .NET WebSockets forcibly closed despite keep-alive and ...
I ran into this issue this week. Your workaround got me pointed in the right direction, but I believe I've narrowed down the...
Read more >
Configuration — Converse 10.0.0 documentation
Automatically reconnect to the XMPP server if the connection drops unexpectedly. This option works best when you have authentication set to prebind and...
Read more >
Timeouts - websockets 10.4 documentation - Read the Docs
To avoid these problems, websockets runs a keepalive and heartbeat mechanism based on WebSocket Ping and Pong frames, which are designed for this...
Read more >
Modules Options - ejabberd Docs
Manually setup WebSocket url, and use the public Converse client: ... Security issue: Namespace delegation gives components access to sensitive data, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found