Fix localhost reference.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Shogi.UI.Identity;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Shogi.UI.Shared;
|
||||
|
||||
@@ -8,10 +7,16 @@ public class GameHubNode : IAsyncDisposable
|
||||
{
|
||||
private readonly HubConnection hubConnection;
|
||||
|
||||
public GameHubNode()
|
||||
public GameHubNode(IConfiguration configuration)
|
||||
{
|
||||
var baseUrl = configuration["ShogiApiUrl"];
|
||||
if (string.IsNullOrWhiteSpace(baseUrl))
|
||||
{
|
||||
throw new InvalidOperationException("ShogiApiUrl configuration is missing.");
|
||||
}
|
||||
|
||||
this.hubConnection = new HubConnectionBuilder()
|
||||
.WithUrl(new Uri("https://localhost:5001/gamehub", UriKind.Absolute), options =>
|
||||
.WithUrl(new Uri($"{baseUrl}/gamehub", UriKind.Absolute), options =>
|
||||
{
|
||||
options.HttpMessageHandlerFactory = handler => new CookieCredentialsMessageHandler { InnerHandler = handler };
|
||||
options.SkipNegotiation = true;
|
||||
|
||||
Reference in New Issue
Block a user