You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a realtime angular 7 webapp using signalr and aspnet Web backend, but I noticed that firefox can't establish a connection using signalR? The funny thing is this: Chrome and Edge CAN connect and send and receive data to the hub. Just not firefox...
If I look in to my SocketAPI Project dependencies I can see I got these SignalR packages installed:
I've set up cors on my SocketAPI Startup.cs like so:
Inside my ConfigureServices Method i have this Code:
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new RequireHttpsAttribute());
});
//*************************
// Setup CORS For SignalR *
//*************************
services.AddCors(options => options.AddPolicy("CorsPolicy", builder =>
{
builder
.WithOrigins(Configuration.GetSection("URIs").GetValue<string>("CLIENT_URL")) // Only allow adress of BHR.WebClient
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials();
}));
services.AddSignalR();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}
Inside my Configure Method
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseCors("CorsPolicy");
app.UseSignalR(routes =>
{
routes.MapHub<AppHub>("/app");
});
app.UseHttpsRedirection();
app.UseMvc();
}
Now if I test this on Chrome and Edge then it works but if I try to connect to firefox I get the following error in firefox:
**Firefox can't establish a connection to the server at wss://localhost:44336/app. WebSocketTransport.js:85
[2019-01-16T12:26:53.183Z] Error: Failed to start the connection: null**
But unfortunately this troubleshoot doesn't give a hint for a solution so I hoped I could ask you guys about this error... It's already driving me crazy, because it seems to work on Chrome and Edge... Just not firefox...
Issue description
AspNetCore SignalR 1.1.0 - @aspnet/signalr works on Chrome and EdgeExplorer but not Firefox.
Browsers Tested
Software versions
Question on Stackoverflow Link:
https://stackoverflow.com/questions/54217203/aspnetcore-signalr-1-1-0-aspnet-signalr-works-on-chrome-and-edgeexplorer-but
Detail Description:
I'm trying to create a realtime angular 7 webapp using signalr and aspnet Web backend, but I noticed that firefox can't establish a connection using signalR? The funny thing is this: Chrome and Edge CAN connect and send and receive data to the hub. Just not firefox...
If I look in to my SocketAPI Project dependencies I can see I got these SignalR packages installed:
If I look in my package.json which lives under the WebClient Project, I can see the @aspnet/signalr 1.1.0 npm I've installed:
Server Configuration
I've set up cors on my SocketAPI Startup.cs like so:
Inside my ConfigureServices Method i have this Code:
Inside my Configure Method
I also created a AppHub Class like so:
Clientside Configuration
On the Clientside I have a HubService like this:
The following 'InitHubConnection' Method gets called by the HomeComponent
Now if I test this on Chrome and Edge then it works but if I try to connect to firefox I get the following error in firefox:
I also searched on the MS Docs and found this:
Source : https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/troubleshooting#firefox-cant-establish-a-connection-to-the-server-at-address-error-in-firebug
But unfortunately this troubleshoot doesn't give a hint for a solution so I hoped I could ask you guys about this error... It's already driving me crazy, because it seems to work on Chrome and Edge... Just not firefox...
Any help on this one is highly appreciated!
dotnet --info output or About VS info
The text was updated successfully, but these errors were encountered: