Ejabberd and websocket.js client connection issue

163 views
Skip to first unread message

Manoj Kumar Baghela

unread,
Jun 1, 2018, 1:29:41 AM6/1/18
to Strophe
I have installed ejabberd with Ubuntu os. 

1. Configuration has done and able to login and chat with spark and jabber clients. 
2. Now try to connect with websocket.js client then getting below response from server:


Websocket client:




ejabberd.yml configuration:

    port: 5280

    ip: "::"

    module: ejabberd_http

    request_handlers:

      "/ws": ejabberd_http_ws

      "/bosh": mod_bosh

      "/a/b/": mod_foo

      "/api": mod_http_api

    ##  "/pub/archive": mod_http_fileserver

    web_admin: true

    ##certfile: "/opt/ejabberd/manoj.pem"

    ##starttls: true

    http_bind: true

    ## register: true

    captcha: true



Client Request:
 

<?xml version="1.0"?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" version="1.0" xmlns="jabber:client" to="X.X.X.X" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace" >


Server Response:

<stream:stream id='14357089037025069057' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>


<stream:error><not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>XML or text declaration not at start of entity</text></stream:error>



Kindly anyone can help me that what am I missing in ejabberd configuration and web client. 


Regards,

Manoj

Jonathan Andrade

unread,
Jun 1, 2018, 10:51:21 PM6/1/18
to Strophe

hey bro in apache correct is configurations

 

ProxyRequests Off

<Proxy *>

  AddDefaultCharset UTF-8

  Options +MultiViews

  Order deny,allow

  Deny from all

  Allow from all

</Proxy>

 

ProxyPass /xmpp-httpbind ws://localhost:5280/xmpp

ProxyPassReverse /xmpp-httpbind ws://localhost:5280/xmpp

RewriteEngine On

RewriteRule /xmpp-httpbind/ ws://localhost:5280/xmpp

 

Reply all
Reply to author
Forward
0 new messages