WebSockets transport pings the wrong server URL. #2569

Closed
NTaylorMullen opened this Issue Sep 19, 2013 · 7 comments

Comments

Projects
None yet
5 participants
Contributor

NTaylorMullen commented Sep 19, 2013

This is a blatant bug. We special case websockets when creating the URL and we shouldn't.

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Sep 20, 2013

@NTaylorMullen NTaylorMullen Modified the ping server to no longer special case websockets and to …
…use the connection.url.

- Also added a test to verify the fix.

#2569
d2bdef6
Contributor

gustavo-armenta commented Sep 27, 2013

tested on websockets, pingServer is invoked periodically sending a request to "/signalr/ping?connectionData=%5B%7B%22name%22%3A%22hubconnectionapi%22%7D%5D".
Response is "pong" and the deferral is completed.

I can still repro with version 2.0.0 downloaded through nuget - https://github.com/tonyeung/signalr
Is there a new version published already somewhere since the bug is listed as closed and done?

Contributor

gustavo-armenta commented Nov 18, 2013

@gustavo-armenta

Thanks, I went ahead and just replaced the offending line with this - url = connection.url + "/ping";

oflahero commented Dec 5, 2013

Hi there - I'm still seeing this also with nuget 2.0.0 in a websocket & x-domain environment, and using a websocket port of 6757. The ping ajax() is called with just the relative URL, which in the console causes a request to http://server/signalr/ping..., which 404s (presumably port 80).

Similarly to tonyeung above, if I hack signalr JS and replace
baseUrl = connection.transport.name === "webSockets" ? "" : connection.baseUrl;
with
baseUrl = // connection.transport.name === "webSockets" ? "" :
connection.baseUrl;

...all is well.

Owner

davidfowl commented Dec 5, 2013

It's been fixed but there's no official version with the fix. Are you using nightlies? If not then you do not have the fix and what you're describing is expected.

oflahero commented Dec 5, 2013

Thanks David. Makes sense so.

Great work, by the way. Still amazed at the simplicity and ease-of-use of SignalR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment