title: how to run StartAsync connection of signalr blazor client in docker image?
body: <p>I created default blazor server side app. Then added <code>Microsoft.AspNetCore.SignalR.Client</code> and <code>ChatHub</code> class. Then edited startup.cs file (add <code>services.AddSignalR()</code> and <code>endpoints.MapHub&lt;ChatHub&gt;("/chatHub")</code>) and <code>index.razor</code> page. Then run by IIS express. it is okey. </p>
  
  <p>Then added docker support and run Docker host. it is not working. Because only don't work hub connection StartAsync method. How to run it? Help me?
  Thank you very much guys.</p>
  
  <p>Error is: </p>
  
  <blockquote>
    <p>An unhandled exception occurred while processing the request.
    SocketException: Cannot assign requested address
    System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)</p>
    
    <p>HttpRequestException: Cannot assign requested address
    System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)</p>
  </blockquote>
  
  <p>index.razor code:</p>
  
  <pre><code>@code {
      private HubConnection _hubConnection;
  
      protected override async Task OnInitializedAsync()
      {
          _hubConnection = new HubConnectionBuilder()
              .WithUrl(NavigationManager.ToAbsoluteUri("/chatHub"))
              .Build();
  
          _hubConnection.On&lt;string, string&gt;("ReceiveMessage", (user, message) =&gt;
          {
              var encodedMsg = $"{user}: {message}";
              StateHasChanged();
          });
  
          await _hubConnection.StartAsync(); // **DON'T WORK IN DOCKER HOST.**
      }
  }
  </code></pre>
  
  <p>Docker file:</p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
  WORKDIR /src
  COPY ["BlazorApp1/BlazorApp1.csproj", "BlazorApp1/"]
  RUN dotnet restore "BlazorApp1/BlazorApp1.csproj"
  COPY . .
  WORKDIR "/src/BlazorApp1"
  RUN dotnet build "BlazorApp1.csproj" -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish "BlazorApp1.csproj" -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT ["dotnet", "BlazorApp1.dll"]
  </code></pre>