Not allowed by Access-Control-Allow-Origin

Hi

I’m trying to create a webchat with openfire and strophe.js.

I’ve installed openfire and started it. I can use the adminpanel in :9090 so it works.

When triyng the basic example from strophe i get this error:

XMLHttpRequest cannot load http://jabber.potterskolen.dk:7070/http-bind/. Origin http://jabber.potterskolen.dk is not allowed by Access-Control-Allow-Origin.

How can i allow it?

Blocking me either.

On Server Settings -> HTTP Binding there’s an option “Provide support for CORS” that needs to be suitably enabled. If it is already enabled, I’m afraid I’m out of ideas.

(another) Greg

The “Provide support for CORS" has been set to “enable”, but when send the request, server will return http status with 503.

Same problem here. I am setting up Converse and seeing these errors in the console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://blah/http-bind/. (Reason: CORS request did not succeed). Status code: (null).

After a while Converse times out with this error:

Connection failure
An error occurred while connecting to the chat server.

My inverse plugin is set up as follows:

The firewall is open for these ports. I can go to both 7070 and 7443 addresses from the config and see this, so nothing is being blocked unless I am missing something:

This was easy! The snippet for Apache on the documentation page Setup and integration — Converse 10.1.4 documentation
has to be applied on the site that is hosting Converse, and then it works fine. Also ensure that firewall is open to the destination.

1 Like