Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8844731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:33:39+00:00 2026-06-14T11:33:39+00:00

I’m trying to put together a simple Hello World style application with SignalR. The

  • 0

I’m trying to put together a simple “Hello World” style application with SignalR. The slightly complicating factor is that the SignalR hubs need to be self-hosted, not in IIS/ASP.NET. I’ve got the server-side working, so far as I can tell, and it’s available on port 8080, but I’m having trouble wiring up the client. The problem I’m bumping up against at the moment is that the SignalR client seems to be ignoring the port on the URL that I specify.

Specifically, I’ve got this code here:

<head runat="server">
    <script type="text/javascript" src="/Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/Scripts/json2.min.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.signalR-0.5.3.js"></script>
    <script type="text/javascript" src="http://<%=Request.Url.Host %>:8080/signalr/hubs"></script>
    <title>SignalR Test</title>
</head>
<body>
    <script type="text/javascript">
        $(function () {

            // Wire up the client to the SignalR server on the same host 
            // as the source of this page, but on port 8080.
            $.connection.url = "http://<%=Request.Url.Host %>:8080/signalr";
            var roomHub = $.connection.roomHub;

            $('#echoButton').click(function () {
                roomHub.echo($('#echoButton').val())
                    .error(function (err) {
                        alert(err);
                    });
            });

            $.connection.hub.start({ transport: 'auto', xdomain: true })
                .done(function () {
                    console.log('Connected.');
                })
                .fail(function (e) {
                    console.log('Unable to connect:' + e);
                });
        });
    </script>

The :8080/signalr/hubs script loads successfully, and it looks good, i.e., it has the definition for the roomHub in it, so I know that the server is up and running.

However, when $.connection.hub.start() runs, it seems like it should try to open up a connection for a URL something like http://app.dev.alanta.com:8080/signalr/signalr/negotiate?=1353072553935. Instead, Firebug tells me that it’s ignoring the 8080 portion, and is instead trying to negotiate a connection with the URL http://app.dev.alanta.com/signalr/signalr/negotiate?=1353072553935. And of course, that doesn’t work – there’s no SignalR service listening on port 80, just the regular web server – so it fails with the message, “Unable to connect:SignalR: Error during negotiation request”.

I should also note that in the jquery.signalR-0.5.3.js file, the bit of code that parses out the connection does indeed seem to ignore the port:

// Resolve the full url
parser.href = connection.url;
if (!parser.protocol || parser.protocol === ":") {
    connection.protocol = window.document.location.protocol;
    connection.host = window.document.location.host;
    connection.baseUrl = connection.protocol + "//" + connection.host;
}
else {
    connection.protocol = parser.protocol;
    connection.host = parser.host;
    connection.baseUrl = parser.protocol + "//" + parser.host;
}

// Set the websocket protocol
connection.wsProtocol = connection.protocol === "https:" ? "wss://" : "ws://";

Is this a bug? Or have I misunderstood something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:33:40+00:00Added an answer on June 14, 2026 at 11:33 am

    Well, I could swear that I’d tried this and it didn’t work, but as I was troubleshooting it some more, I changed the URL assignment from this:

    $.connection.url = "http://<%=Request.Url.Host %>:8080/signalr";
    

    To this:

    $.connection.hub.url = "http://<%=Request.Url.Host %>:8080/signalr";
    

    And to be sure, this is how it’s documented here. I thought that I’d seen it documented the first way somewhere, but I can’t find it now. Oh well. Chalk this one up to my not paying enough attention.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.