xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.18k stars 372 forks source link

XMPP Not connecting with live server #856

Closed akramkhan1102 closed 3 years ago

akramkhan1102 commented 3 years ago

I have susccefully configuired mongooseIM on my local and it's working fine on my app with local server, i can send message to the registerd client with local connection through webSocket and thet url is ws://localhost:5280/ws-xmpp But it is not working with live url that is somthing like ws://chat.example.com:5285/ws-xmpp also i have tried with wss as there is SSL on live but that is not working as well

When i am trying to connect client with local server then the connection status somthing like below screenshot

Screenshot 2020-09-18 at 12 47 55 AM

When i am trying to connect client to the live server then the connection status like below screenshot

Screenshot 2020-09-18 at 12 49 47 AM

I have also enebeld websocket in my .cfg file as you can see below

{modules, [
           {"_", "/http-bind", mod_bosh},
           {"_", "/ws-xmpp", mod_websockets, [
           %% Uncomment to enable connection dropping or/and server-side pings
           %{timeout, 600000}, {ping_rate, 60000}
           ]}
           %% Uncomment to serve static files
           %{"_", "/static/[...]", cowboy_static,
           %  {dir, "/var/www", [{mimetypes, cow_mimetypes, all}]}
           %},
       ]}

Please let me know what i need to configure in my server .cfg file or do i need to add somthing with xmpp/client ?

sonnyp commented 3 years ago

host-unknown error means that you are not passing the right domain

see https://github.com/xmppjs/xmpp.js/tree/master/packages/client#client-1

akramkhan1102 commented 3 years ago

Thank you @sonnyp , it's working now