title: How to connect to a SignalR self-host wpf app remotely?
body: <p>I am trying to connect to my self-hosted SignalR server remotely using a web-based client. I can successfully connect to the server locally, but I cannot connect to the server remotely.</p>
  <p>When I type (self-hosted ip4 address):7777/signalr/hubs in the URL of my remote browser, I see the generated hubs file. Therefore, I believe that I'm making a connection. But I want to see the web page. If you couldn't tell already, I'm a beginner to SignalR</p>
  <p>2 more questions:</p>
  <ol>
  <li>What URL should I type into the other computer's web browser to connect to my server?</li>
  <li>What code determines what that URL is?</li>
  </ol>
  <p><strong>Here's my code</strong></p>
  <p>The self-hosted SignalR server (a wpf application)</p>
  <pre><code>public partial class MainWindow : Window
  {
      IDisposable SignalR;
      private string url = &quot;http://*:7777&quot;;
  
      public MainWindow()
      {
          InitializeComponent();
  
          SignalR = WebApp.Start(url);
          Console.WriteLine(&quot;Server running on {0}&quot;, url);
      }
  }
  </code></pre>
  <p>Startup class</p>
  <pre><code>class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          app.UseCors(CorsOptions.AllowAll);
          app.MapSignalR();
      }
  }
  </code></pre>
  <p>Index Page (scripts)</p>
  <pre><code>@section scripts
  {
      &lt;!--Reference the jQuery library. --&gt;
      &lt;script src=&quot;~/Scripts/jquery-3.4.1.min.js&quot;&gt;&lt;/script&gt;
      &lt;!--Reference the SignalR library. --&gt;
      &lt;script src=&quot;~/Scripts/jquery.signalR-2.4.3.min.js&quot;&gt;&lt;/script&gt;
      &lt;!--Reference the autogenerated SignalR hub script. --&gt;
      &lt;script src=&quot;http://localhost:7777/signalr/hubs&quot;&gt;&lt;/script&gt;
      &lt;!--Add script to update the page and send messages.--&gt;
      &lt;script src=&quot;~/MyScripts/Main.js&quot;&gt;&lt;/script&gt;
  }
  </code></pre>
  <p>My js file</p>
  <pre><code>$(function () {
      $.connection.hub.url = &quot;http://localhost:7777/signalr&quot;;
  
      var hub = $.connection.mainHub;
  
      $.connection.hub.logging = true;
      $.connection.hub.log(&quot;Trying to connect...&quot;);
  
  
      // Start connection
      $.connection.hub.start()
          .done(function () {
              $.connection.hub.log('Now connected, connection ID=' + $.connection.hub.id);
              });
          })
          .fail(function () {
              $.connection.hub.log(&quot;Error!&quot;);
          });
  });
  </code></pre>