I/O操作由于线程出口或应用程序请求而被中止
我正在尝试使用 Yarp 作为反向代理连接 signalR 端点。
但是我遇到了这个错误:
yarp 配置是:
"ReverseProxy": {
"Clusters": {
"ws-cluster": {
"Destinations": {
"ws-destination1": {
"Address": "http://localhost:8240"
}
}
}
},
"Routes": {
"dev-ws": {
"ClusterId": "ws-cluster",
"CorsPolicy": "any",
"Match": {
"Path": "ws/{**catch-all}"
}
}
}
}
信号 R 端点是:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAuthentication();
app.UseRouting();
app.UseCors(MyAllowSpecificOrigins);
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<HubService>("/ws");
endpoints.MapControllers().RequireCors(MyAllowSpecificOrigins);
});
}
当我调用时,网关有一些奇怪的地方ws://localhost:8000/ws
(网关已托管在端口 8000 上)在服务器内部,它可以工作!但如果我使用它的域名 从服务器外部不会!
IIS 有问题还是我需要应用特定配置?
I am trying to connect signalR endpoint using Yarp as a reverse proxy.
However I faced this error:
The yarp configuration is:
"ReverseProxy": {
"Clusters": {
"ws-cluster": {
"Destinations": {
"ws-destination1": {
"Address": "http://localhost:8240"
}
}
}
},
"Routes": {
"dev-ws": {
"ClusterId": "ws-cluster",
"CorsPolicy": "any",
"Match": {
"Path": "ws/{**catch-all}"
}
}
}
}
and the signalR endpoint is:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAuthentication();
app.UseRouting();
app.UseCors(MyAllowSpecificOrigins);
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<HubService>("/ws");
endpoints.MapControllers().RequireCors(MyAllowSpecificOrigins);
});
}
And there is something strange about the gateway, when I call ws://localhost:8000/ws
(The gateway has been hosted on port 8000) inside the server, it works! but if I use its domain
from outside of the server it won't!
Is there a problem with IIS or do I need to apply a specific configuration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论