【发布时间】:2021-03-01 21:31:18
【问题描述】:
我在我的应用程序中使用 signalR,在 Azure 门户上上传 ocelot 网关时出错
我的ts代码
this.hubConnection = new signalR.HubConnectionBuilder()
.withUrl("https://url.azurewebsites.net/gatewayOcelot/notification", {
skipNegotiation: true,
transport: signalR.HttpTransportType.WebSockets
})
.build();
而豹猫路线是
{
"UpstreamPathTemplate": "/gatewayOcelot/{url}",
"UpstreamHttpMethod": [ "Get", "Put", "Delete", "Post", "Patch", "OPTIONS" ],
"DownstreamPathTemplate": "/api/{url}",
"DownstreamScheme": "wss",
"DownstreamHostAndPorts": [
{
"Host": "apiURL.com",
"Port": 443
}
],
"HttpHandlerOptions": {
"AllowAutoRedirect": true
}
},
启动代码
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapHub<NotificationHub>("/api/notification");
});
得到错误
WebSocket connection to 'wss://url.azurewebsites.net/gatewayOcelot/notification' failed: Error during WebSocket handshake: Unexpected response code: 502
【问题讨论】:
标签: azure websocket signalr ocelot