librelist archives

« back to archive

Fw: 'Access-Control-Allow-Origin' Error from Converse.js

Fw: 'Access-Control-Allow-Origin' Error from Converse.js

From:
Gaviya R
Date:
2014-10-14 @ 11:23
could not decode message

Re: [conversejs] FW: 'Access-Control-Allow-Origin' Error from Converse.js

From:
Jc Brand
Date:
2014-10-15 @ 12:52
On Tue, Oct 14, 2014 at 11:23:18AM +0000, Gaviya R wrote:
> 
>    I am trying to build a chat application and getting this error
>    continuously when I use converse.js.
> 
>    XMLHttpRequest cannot load [1]http://localhost/http-bind/. No
>    'Access-Control-Allow-Origin' header is present on the requested resource.
>    Origin 'http://localhost:1400' is therefore not allowed access.
> 
>    I have created my own jabber server with OPENFIRE.
> 
>    My web application runs in a different port on an apache server.
> 
>    Below is the config I have given in my apache conf file,
> 
>    Apache config:
> 
>    <VirtualHost *:1400>
> 
>        Header set Access-Control-Allow-Origin "*"
> 
>        ServerName localhost
> 
>        RewriteEngine On
> 
>        RewriteRule ^/http-bind(.*) [2]http://localhost:7070
> 
>    </VirtualHost>
 
Check in the developer console of your browser whether you can see that the
Access-Control-Allow-Origin header is set and returned when you call http-bind.