Friday, 23 August 2013

Generated url's are seems to be wrong

Generated url's are seems to be wrong

I created an application with signalR references in visual studio. Created
a hub. When running application on IIS Express, everything works fine.
When I transfer it to IIS8, in firebug I see that URL's of signalR are
wrong, for instance:
http://localhost/signalr/negotiate?connectionData=......
The problem that there is a missing site name, should be:
http://localhost/MYSITE/signalr/negotiate?connectionData=......
This is the script I am using to init connection:
<script type="text/javascript">
var proxy;
$(function () {
var connection = $.hubConnection();
proxy = connection.createHubProxy('chatHub');
proxy.on('newMessage', onNewMessage);
connection.start();
$('#send').click(onSend);
});
function onNewMessage(message) {
$('#messages').append('<li>' + $('#message').val() + '</li>');
}
function onSend() {
proxy.invoke('newMessage', $().val());
}
</script>
I tried to send connection to $.hubConnection(), but then site name is
getting doubled:
http://localhost/MYSITE/MYSITE/signalr/negotiate?connectionData=......

No comments:

Post a Comment