Web Api和端口转发 [英] Web Api and Port Forwarding

查看:290
本文介绍了Web Api和端口转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows服务中创建了一个自托管的webapi服务。这意味着如果我想从外界访问此服务,我将需要实现端口转发。



我遇到的问题如下:



我可以访问这项服务,当windows服务正在运行它,从浏览器我可以使用我的计算机名称,我的计算机IP地址192.168 ....,但如果我尝试我们的路由器提供的端口转发我得到谚语连接主动拒绝错误。我相信端口转发是正确设置的,这种拒绝是由Web Api服务引起的,也不是它处理端口转发的方式。

I have created a self hosted webapi service in a Windows Service. This means that if I want this service accessed from the outside world, I will need to implement port forwarding.

The problem I am having is the following:

I can access this service, when the windows service is running it, from a browser I can use my computer name, My computers IP address 192.168...., but if I try the port forwarding provided by our router I get the proverbial connection actively refused error. I believe the port forwarding is set up correctly and that this refusal is caused by the Web Api service and way it does not handle the port forwarding.

推荐答案

在第一次如果您只使用IP访问您的服务,但是当您使用端口转发时,您也使用端口号 - 可能是一个未打开的端口号...

去检查您从外部转发的端口和内部:

外部: http://canyouseeme.org/ [ ^ ]

内部: TCPView [ ^ ]
In the first case you are accessing your service with IP only, but when you use port forwarding you are also use a port number - probably one that is not open...
Go and check you port forwarding from outside and the inside:
Outside: http://canyouseeme.org/[^]
Inside:: TCPView[^]


这篇关于Web Api和端口转发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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