How do I remotely access self-hosted Nancy service?

后端 未结 2 1318
刺人心
刺人心 2021-01-14 12:50

I am creating a simple Windows service that hosts a Nancy instance to provide views of its internal data. Everything works as expected when using a browser on the local mach

2条回答
  •  天涯浪人
    2021-01-14 13:00

    This answer provided the clue I needed. https://stackoverflow.com/a/21364604/1139376

    This is because HttpListener is built on top of http.sys which will listen on the port you specified on behalf of your program.

    It wasn't my EXE doing the actual listening. All I needed to do was to add an Incoming rule to the Windows Firewall set for the "System" program and the specific TCP port I'm using. That allowed remote access.

提交回复
热议问题