Error Connecting to Openfire 4.6.3 using WebSockets


I am using Openfire 4.6.3 and trying to do a simple connection test from Postman. Using http://localhost:7070/ws I get the following error in postman:

HTTP ERROR 405 HTTP method GET is not supported by this URL
URI:	/ws/
MESSAGE:	HTTP method GET is not supported by this URL
SERVLET:	org.jivesoftware.openfire.websocket.OpenfireWebSocketServlet-2fbd10

There are no log entries in Openfire for this. In this version of Openfire, is there something I need to configure to allow for web sockets?


:thinking: i think the url have to start with ws:// or wss://

edit: i searched in the forum and the answer is:

ws://address:7070/ws/ (unsecured connection)
wss://address:7443/ws/ (secured connection)

the ports depend on your configuration…

1 Like

Using ws or wss does a disconnect right away. This could be an issue with Postman and its beta functionality for web socket support.

maybe … but the websocket endpoint is listening to xmpp data of cource …
you could use strophe.js and configure the lib to you use websockets…

The portal app being used is Kaiwa and was put together a few years ago, unfortunaetly before my time with the company - I get to inherit the mess :slight_smile:

For Openfire 4.6.3, I assume it works out of the “Box” and there are no plugins, etc that need to be included or set.

I Kaiwa seems not to be maintained… last commits were made in 2015?! I would suggest you to use either converse.js or jsxc. There are plugins for using with openfire…

That is correct: websockets are supported out-of-the-box with this version of Openfire. They will be enabled when http-bind is enabled (which by default is the case).

Furthermore, @totzkotz is correct: you’ll need to use the ws URL scheme, instead of http (or wss instead of https). I’m not sure if your testing tool supports this. One way to go about testing this would be to use another web-based XMPP client, to see if that will work with websockets. That way, you’re ruling out your client as the source of the problem.