Hosting WebAPI using OWIN in a windows service

后端 未结 6 892
暖寄归人
暖寄归人 2020-12-02 09:23

I\'ve self-hosted Web API using OWIN (inside a windows service). From what I understand, this is enough to make HTTP requests come to the windows service. I\'m able to hit t

6条回答
  •  春和景丽
    2020-12-02 09:56

    This is actually a simple oversight I also tripped on: If you only listen to requests on localhost, 127.0.0.1, etc -- no one will ever see it because only YOU (self) understands you as that target. On my machine I am localhost, if I req your IP on any port, that service would see get http://your_ip:80, not localhost. All you have to do is serve on "http://*:{0}", and that way you can onStart() pass the port.

提交回复
热议问题