ServiceStack 与 Windows 服务的通信 [英] ServiceStack communications with Windows Service

查看:35
本文介绍了ServiceStack 与 Windows 服务的通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个多层应用程序.我使用带有 ServiceStack (AppHostHttpListenerBase) 的 http 与 Windows 服务进行通信.虽然这在干净的环境中工作正常,但我经常发现客户的计算机不是那么干净,首要问题之一是引入了不需要的代理,导致我的应用程序无法运行.我收到很多坏消息,说应用程序不能正常工作,而实际上这是客户机器上隐藏问题的结果.当我去查询我的端点时,代理会干扰并且我失去了与服务的所有通信.

I have an multi layered application that I have developed. I communicate with the windows service using http with ServiceStack (AppHostHttpListenerBase). While this works fine in clean environments, I often find that customers computers are not so clean and one of the first problem areas is the introduction of an unwanted Proxy with causes my application not to run. I get alot of bad press that the application does not work well, when in reality it is a result of a hidden issue on the customer machine. When I go to query my endpoints the proxy interferes and I lose all communications with the Service.

我正在考虑回到 WCF 并使用命名管道,但在我这样做之前,想知道在 ServiceStack 世界中是否有更好的方法(我非常喜欢)想法?建议?

I am thinking of going back to WCF and using namedpipes but before I do so, wondered if there was a better way in the ServiceStack world (Which I absolutely love) Ideas? Suggestions?

推荐答案

如果本地 HTTP 代理导致问题,您可以尝试的一件事是使用 SSL,它可以让您将流量作为不透明的二进制文件通过其代理进行隧道传输,从而最大限度地降低潜在风险以防干扰.

If a local HTTP proxy is causing issues one thing you could try is to use SSL which will let you tunnel your traffic as an opaque binary through their proxy minimizing potential for interference.

为 HttpListener 配置 SSL 的配置方式与所有 HttpListener 的配置方式相同,即它不是特定于 ServiceStack - 并且需要在运行它的操作系统上进行配置.

Configuring SSL for HttpListener is configured the same way for all HttpListener's, i.e. it's not specific to ServiceStack - and it needs to be configured on the OS where it's run.

此答案显示了如何在 Windows 上配置 SSL:https://stackoverflow.com/a/11457719/85785

This answer shows how to configure SSL on Windows: https://stackoverflow.com/a/11457719/85785

您可以按照上述步骤将 https 与 ServiceStack HttpListener 自托管一起使用,我使用https://*:8443/"作为 url,使用CN=localhost"绕过 SSL 浏览器警告对话框.

You'll be able to use https with ServiceStack HttpListener self-host by following the steps above, I used "https://*:8443/" for the url and "CN=localhost" to bypass the SSL browser warning dialog.

答案中没有特别明确,但您可以从证书的详细信息选项卡中获取指纹,然后需要删除空格.如果更简单,您可以按照以下答案中的演练使用 MMC 导入证书:https://stackoverflow.com/a/33905011/85785

It's not specifically clear in the answer but you can get the Thumbprint from the details tab of the certificate where you then need to remove spaces. If it's easier, you can follow the walkthrough in the answer below to use MMC to import the certificate: https://stackoverflow.com/a/33905011/85785

这篇关于ServiceStack 与 Windows 服务的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆