无法连接到自托管 gRPC Windows 服务
cannot connect to self-hosted gRPC Windows service
我在测试服务器上发布了我的第一个 gRPC Windows 服务。 请原谅我的笨拙.
长话短说:
当我尝试通过客户端连接到它时,出现以下错误:
No connection could be made because the target machine actively
refused it. SocketException: No connection could be made because the
target machine actively refused it.
这是我在 Kestrel 上的 appsettins.json:
"HttpsInlineCertStore": {
"Url": "https://localhost:5001",
"Certificate": {
"Subject": "CN=<secret>",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": "true"
}
}
在我的客户端上,我有这个:
readonly static GrpcChannel channel =
GrpcChannel.ForAddress("https://full server name and domain:5001");
问题:
我一直看到端口 5000 被打开,但没有打开 5001。为什么?
谢谢!
更新:
默认情况下,http 为 5000。这里是 MS link...搜索端点配置
我在测试服务器上发布了我的第一个 gRPC Windows 服务。 请原谅我的笨拙.
长话短说: 当我尝试通过客户端连接到它时,出现以下错误:
No connection could be made because the target machine actively refused it. SocketException: No connection could be made because the target machine actively refused it.
这是我在 Kestrel 上的 appsettins.json:
"HttpsInlineCertStore": {
"Url": "https://localhost:5001",
"Certificate": {
"Subject": "CN=<secret>",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": "true"
}
}
在我的客户端上,我有这个:
readonly static GrpcChannel channel =
GrpcChannel.ForAddress("https://full server name and domain:5001");
问题: 我一直看到端口 5000 被打开,但没有打开 5001。为什么?
谢谢!
更新: 默认情况下,http 为 5000。这里是 MS link...搜索端点配置