-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse Proxy => Problem with generated Proxy URL #3776
Comments
Working fix for me: from
changed/added
Works on / (root) if not defined or for reverse proxy if defined |
or instead of completely reimplementing the function, we just change its output : var getUrl = $.signalR.transports._logic.getUrl;
$.signalR.transports._logic.getUrl = function(connection, transport, reconnecting, poll, ajaxPost) {
var url = getUrl(connection, transport, reconnecting, poll, ajaxPost);
return connection.url + url.substring(url.indexOf(connection.appRelativeUrl) + connection.appRelativeUrl.length);
}; |
This issue has been closed as part of issue clean-up as described in https://blogs.msdn.microsoft.com/webdev/2018/09/17/the-future-of-asp-net-signalr/. If you're still encountering this problem, please feel free to re-open and comment to let us know! We're still interested in hearing from you, the backlog just got a little big and we had to do a bulk clean up to get back on top of things. Thanks for your continued feedback! |
I have this Problem! |
Expected behavior
If you define URL on jQuery Client, SignalR Client should stick to the URL even
with generated proxies.
Problem is, MVC is running App on / (root) on IIS.
SSL is added by a reverse proxy where the / is rewritten to /whatever
Of course signalR thinks /signalr/hubs is therefore correct, but for browser it's /whatever/signalr/hubs
There should be posibility to tell jquery client always use a certain start url
on any calls, or at least always take the relative url passed as parameter defined in client.
Actual behavior
when is set on jquery client $.connection.hub.url = "/whatever/signalr/hubs"
negotiate works HTTP 200, but in result the Url path is the one generated by
proxy from IIS AppPool with is not the url set on client.
So the following connect is 404 because of taking the URL from hub/negotiate reply is for this wrong.
Steps to reproduce
use any reverse proxy (apache/nginx/etc) and map the IIS application to another url
than it's used with IIS directly. hub.url will only be used once for the generated proxies.
negotiate
the result of it
connect call canceled because wrong url
Even with non generated proxies same problem:
Server generated URL always wins.
The text was updated successfully, but these errors were encountered: