Hi, I've developed a .Net Service applicaiton and added a signalR hub. The service seems to work and start without errors. But when I try to connect from my wearable web app using the SignalR js client I get error "failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED"
I know server applications typically use messageport for comms, but i'm trying to port some signalR service logic and code to use as communication between my client and service.
Server Startup.cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseWebSockets();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<WSHub>("/ws", options => options.Transports = Microsoft.AspNetCore.Http.Connections.HttpTransportType.WebSockets);
});
}
I've added these to my client config.xml
<access origin="h_ttp://127.0.0.1:5000" subdomains="false"></access>
<access origin="ws://127.0.0.1:5000" subdomains="false"></access>
connecting like this:
this.srConn = new signalR.HubConnectionBuilder()
.withUrl(`h_ttp://127.0.0.1:5000/ws`, { skipNegotiation: true, transport: signalR.HttpTransportType.WebSockets })
.withAutomaticReconnect()
.configureLogging(signalR.LogLevel.Information)
.build();
await this.srConn.start()
Is there somethig in the .Net manifest I need to declare to allow a tcp port maybe?
Anyone know if this should work? and if not, why not?
Cheers
Devron