- ABP Framework version: v7.2.1 - Micro Service
- UI Type: Angular
- Database System: MongoDB
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
Do you have a sample code for SignalR send message to Angular app. Angular get 502 for negociate.
In Micro Service Application module: typeof(AbpAutoMapperModule),
Configure<AbpSignalROptions>(options =>
{
options.Hubs.AddOrUpdate(
typeof(NotificationHub), //Hub type
config => //Additional configuration
{
config.ConfigureActions.Add(hubOptions =>
{
//Additional options
hubOptions.LongPolling.PollTimeout = TimeSpan.FromSeconds(30);
});
}
);
});
In Gateway module:
app.UseWebSockets();
app.UseOcelot().Wait();
app.UseRouting()
{
"ServiceKey": "SignalR Service",
"DownstreamPathTemplate": "/signalr-hubs/{evertything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 45186
}
],
"UpstreamHttpMethod": [ "POST" ],
"UpstreamPathTemplate": "/signalr-hubs/{evertything}",
"ReRouteIsCaseSensitive": false
},
{
"ServiceKey": "SignalR Service",
"DownstreamPathTemplate": "/signalr-hubs/{everything}",
"ReRouteIsCaseSensitive": false,
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 45186
}
],
"UpstreamPathTemplate": "/signalr-hubs/{anyHub}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ]
},
3 Answer(s)
-
0
Hi,
Could you share the error log? thanks.
-
0
From Angular App, console: POST https://localhost:44325/signalr-hubs/messaginghub/negotiate?negotiateVersion=1 502
From Gateway log: web-gateway_4420d4f8-1]: [13:53:47 DBG] requestId: 0HMT7TSEGNSB6:0000000D, previousRequestId: no previous request id, message: Downstream url is http://localhost:45186/signalr-hubs/messaginghub/negotiate?negotiateVersion=1 [web-gateway_4420d4f8-1]: [13:53:47 DBG] requestId: 0HMT7TSEGNSB6:0000000D, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error [web-gateway_4420d4f8-1]: [13:53:47 WRN] requestId: 0HMT7TSEGNSB6:0000000D, previousRequestId: no previous request id, message: Error Code: ConnectionToDownstreamServiceError Message: Error connecting to downstream service, exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. [web-gateway_4420d4f8-1]: ---> System.IO.IOException: The response ended prematurely.
-
0
HI,
System.Net.Http.HttpRequestException: An error occurred while sending the request. [web-gateway_4420d4f8-1]: ---> System.IO.IOException: The response ended prematurely.
Could you share the full logs? (web gateway& signalr service)