Besat
Besat

Reputation: 1438

can't connect to ejabberd through Kaiwa chat client using websocket

I can't connect to my ejabberd server through Kaiwa chat client. this is my ejabberd server configuration:

hosts:
  - "myserver.com"
listen: 
  - 
    port: 5280
    module: ejabberd_http
    certfile: "/Applications/ejabberd-15.10/conf/myserver.pem"
    request_handlers:
      "/websocket": ejabberd_http_ws
    web_admin: true
    http_bind: true
    captcha: false

and this is my Kaiwa config file:

{
   "isDev": true,
   "http": {
       "host": "localhost",
       "port": 8000
   },
   "server": {
       "domain": "myserver.com",
       "wss": "wss://myserver.com:5280/websocket/"
   }
}

when I try to login I get this error:

WebSocket connection to 'wss://myserver.com:5280/websocket' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED

My ejabberd version is 15.10 which should support websocket.

I would appreciate any help.

Upvotes: 0

Views: 1540

Answers (2)

Besat
Besat

Reputation: 1438

The problem was chrome and Safari. I am not sure why but the client app works perfectly with Mozilla Firefox but does not connect through Safari or Chrome. It could be a security setting. Anyway, switching to mozilla solved my problem.

Upvotes: 1

legoscia
legoscia

Reputation: 41618

While you've specified the certfile option for ejabberd_http, this is not enough to activate encryption (as requested by using wss:// instead of ws://). You also need to specify the tls option:

hosts:
  - "myserver.com"
listen: 
  - 
    port: 5280
    module: ejabberd_http
    certfile: "/Applications/ejabberd-15.10/conf/myserver.pem"
    request_handlers:
      "/websocket": ejabberd_http_ws
    web_admin: true
    http_bind: true
    captcha: false
    tls: true

Upvotes: 1

Related Questions