Websocket connections not working in IE

3,121 views
Skip to first unread message

j2ro

unread,
Sep 25, 2013, 12:01:56 PM9/25/13
to ve...@googlegroups.com
Hi,

We are currently experiencing an issue when trying to create websocket connections against an EventBusBridge server in Internet Explorer (10)

When we try to do so, we see the following error in the browser console:
SEC7118: XMLHttpRequest for http://ourhostname:8080/pushfeed/info?t=1380109920039 required Cross Origin Resource Sharing (CORS).


From what I can gather, it looks like it might be due to the following header missing from the Websocket handshake response (the one after the initial SockJS info request):
Access-Control-Allow-Origin:
*



In this case, the client webpage and server are running on different boxes.


It all works fine in FF and Chrome.

This has been seen on Vertx 1.3.1 and Vertx 2.0.1.


Has anyone seen this before, and if so, is there a quick solution?


Thanks

Kevin R. Pastorino

unread,
Sep 25, 2013, 12:37:34 PM9/25/13
to ve...@googlegroups.com
I'm using websockets without SockJS that is working in both ie and ff - only tested on win7.
 
At www.yardq.com I provide a javascript only solution but since it is vertx you can use it with java, etc.  (See the vertx button there that orbits around on the home page.)
 
It is a free diagnostic program that lets you see event traffic in the browser, the hardest part is, after you download it, you'll need to change two lined in the batch file:
 
Set the paths in the batch file to where you unzip my download
1)  in the batch file change the path to index.html
2)  in the batch file change the first path in the call to vertx
 
Now start the batch file and you should see event messages showing in the browser via websockets.
 
See also

Kevin R. Pastorino

unread,
Sep 25, 2013, 12:40:22 PM9/25/13
to ve...@googlegroups.com
I'm sorry you'll need to change three things in the batch file.
 
The two mentioned and the path to were you have vertx installed.

Tim Fox

unread,
Sep 25, 2013, 12:55:12 PM9/25/13
to ve...@googlegroups.com
Can you file an issue, with some hints on replicating it?

On 25/09/13 17:01, j2ro wrote:
> Hi,
>
> We are currently experiencing an issue when trying to create websocket
> connections against an EventBusBridge server in Internet Explorer (10)
>
> When we try to do so, we see the following error in the browser console:
> SEC7118: XMLHttpRequest for
> http://ourhostname:8080/pushfeed/info?t=1380109920039<http://test.push.betvictor.com:8080/mdss/info?t=1380109920039>required Cross Origin Resource Sharing (CORS).

Tim Fox

unread,
Sep 26, 2013, 7:10:49 AM9/26/13
to ve...@googlegroups.com
I've just taken a quick look at this.

I ran the Java eventbusbridge example from the vertx-examples repo,
using current Vert.x master.

Then I pointed an IE10 browser at it, and it appeared to work ok.

I opened the JavaScript console (F12) and couldn't see any errors there,
but maybe I am looking in the wrong place.

Do you have any tips on how to replicate this?


On 25/09/13 17:01, j2ro wrote:
> Hi,
>
> We are currently experiencing an issue when trying to create websocket
> connections against an EventBusBridge server in Internet Explorer (10)
>
> When we try to do so, we see the following error in the browser console:
> SEC7118: XMLHttpRequest for
> http://ourhostname:8080/pushfeed/info?t=1380109920039<http://test.push.betvictor.com:8080/mdss/info?t=1380109920039>required Cross Origin Resource Sharing (CORS).

Randall Richard

unread,
Sep 26, 2013, 9:07:48 AM9/26/13
to ve...@googlegroups.com
From the description / error, (e.g. "In this case, the client webpage and server are running on different boxes.") looks like in order to replicate, you probably need to serve the page from a different machine / domain then where the SockJS server resides.

-Randall



--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

j2ro

unread,
Sep 26, 2013, 10:15:42 AM9/26/13
to ve...@googlegroups.com
It appears that the reason it wasn't working is that our EventBusBridge server was on a different domain (www.domaina.com) than our main website (www.domainb.com). It looks like IE has a bug (or "feature", depending on your perspective), that prevents the websocket (or a connection using any of the other SockJS fallback methods) being established if the SockJS server is under a different domain. This doesn't currently happen in any of the other major browsers (FF/Chrome/Safari), and they seem perfectly happy regardless.

One thing that was confusing though, is that even when everything is under the same domain (and working), IE still issues the same warning:

SEC7118: XMLHttpRequest for http://ourhostname:8080/pushfeed/info?t=1380109920039 required Cross Origin Resource Sharing (CORS).

I will close the support ticket, as I'm not sure there is anything we can do in Vertx to prevent this from happening. It might be worth us adding a "gotcha" for this issue on the main Vertx website though?

Randall Richard

unread,
Sep 26, 2013, 10:40:04 AM9/26/13
to ve...@googlegroups.com
SockJS is intended to be cross domain connection friendly.  I noticed IE10 is using the rfc6455 Websocket spec.  Perhaps the vertx SockJS Server needs a few tweaks for that version of the protocol?

-Randall


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.

Randall Richard

unread,
Sep 26, 2013, 9:30:30 PM9/26/13
to ve...@googlegroups.com
Out of curiosity, I tried IE10 on a 2.0.1 SockJS server using a page served from a different origin / domain, and although I get the CORS message, everything works fine.

Inline image 1

Some Googling on the SEC7118 error looks to be just a warning in this case and Vertx is returning the appropriate headers which results in a successful Websocket connection.

-Randall

image.png

j2ro

unread,
Sep 27, 2013, 2:25:12 AM9/27/13
to ve...@googlegroups.com
Hi Randall,

Yes, we noticed that we always received this warning in IE10, even in the cases where it is working.

However, until we added a DNS entry for the EventBusBridge server and changed the URL to use this (so that they were both in the same domain) it wasn't working.

Out of interest, are you hosting either the webpage or EventBusBridge/SockJS server from your local machine? IE might be have different security behaviour where localhost is involved.

Randall Richard

unread,
Sep 27, 2013, 7:51:50 AM9/27/13
to ve...@googlegroups.com
No, I'm not using localhost.  However, I did isolate my test to just SockJS open / send / receive (i.e. the EventBusBridge is not involved).  So it sounds like the issue might be related to the EventBustBridge and not SockJS,

 -Randall

j2ro

unread,
Sep 27, 2013, 10:15:37 AM9/27/13
to ve...@googlegroups.com
Just to confirm JS library versions: I'm using sockjs-0.3.4.min.js, vertxbus.js (the latest version) and jquery.min.js (v1.7.1)
Reply all
Reply to author
Forward
0 new messages