Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Cross-domain issues in Chrome and FireFox #1323

Closed
jalchr opened this Issue · 8 comments

3 participants

@jalchr

I'm really sorry if this issue was mentioned before or solved.
We are using alpha1 release and we are observing the following behavior:

1) The hub is pointing to another domain from the one served by the page.
2) When the page first loads, the negotiate and connect both return 200 (works)
3) On consecutive calls, the "connect" returns 503. Need to mention that we use "long Polling" as our default protocol.

connect_bug
Please take note.

@davidfowl
Owner

Can you create a project that demonstrates the problem and send repro steps to do so? There's also a cross domain sample here https://github.com/SignalR/Samples as well. If you can repro it with that project let me know.

@jalchr

We used the sample for investigation and the following configuration causes the above error:

$.connection.hub.start({ transport: ['longPolling', 'webSockets'], jsonp: true }).done(function () {
$('#send').click(function () {
chat.server.send($('#msg').val());
});
});

These two urls show the error online:
http://signalr-test.azurewebsites.net/ (This works fine)
http://signalr-test2.azurewebsites.net/ (This is NOT working with cross domain)

@davidfowl
Owner

I don't see the failure.

@source-code

Hello mr. David,
In order to produce the problem on the test sites, please the follow these steps:

  • make sure you are using firefox or chrome (no problem on IE).
  • start the network monitor (on debugger or firebug).
  • open the site: http://signalr-test2.azurewebsites.net/ which is the cross site.
  • wait for the first request to be timedout, (case of no messages within about 1 minute).
  • you will see that the first request (connect) is "canceled" and no new "connect" or "reconnect" appears. note: this is happening only in case of "jsonp=true"

Untitled

@davidfowl
Owner

That looks specific to azure. When using longpolling there's no keep alive and azure kills idle connections after a minute (that's by design). I'm guessing you don't see this locally. Anyways, here's my log using the latest version of chrome:

site

@davidfowl
Owner

Now I'm totally confused. I opened the browser link you sent:

open the site: http://signalr-test2.azurewebsites.net/ which is the cross site.

Look at the address bar in the image. The site that's loaded is the above url. It's also connected via jsonp longpolling.

So following your repro steps verbatim does NOT reproduce the problem for me. Take a look at the image closely again. If I missed something else let me know which part of the repro steps I missed.

@source-code

yes, i was confused, it seems that the problem does not appears everywhere !!
we did tested it from a remote server, it works fine !!

@davidfowl
Owner

It's likely something to do with the network you're behind killing connections that are idle after a minute. You could try setting the timeout to less than a minute in:

GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(35);
@davidfowl davidfowl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.