Open.NATNAT 遍歷庫
Open.NAT 是為 .NET 和 Mono 設計的 NAT 遍歷庫。Open.NAT 是 NAT 設備端口轉發(fā)的類庫,支持即插即用(UPNP)和端口映射協議(PMP)。
如果你正在開發(fā)類似媒體服務器,文件存儲服務器,即時信息服務器等,你必須知道 NAT 遍歷和計算機與外部設備連接的技術。
要做好這些,你必須熟悉 SSDP,UPNP 或者 PMP 協議,而且不同設備有很多的不同,需要不斷測試。而 Open.NAT 正是提供了這些便利,它非常輕量級,而且提供 NAT 設備端口的轉發(fā),支持 UPNP 和 PMP 協議,使用 C# 編寫,可以為 .NET 和 Mono 服務。
示例:
Your IP: 181.110.171.21Added mapping: 181.110.171.21:1700 -> 127.0.0.1:1600Mapping List +------+-------------------------------+--------------------------------+----------------------------------+ | PROT | PUBLIC (Reacheable) | PRIVATE (Your computer) | Descriptopn | +------+----------------------+--------+-----------------------+--------+----------------------------------+ | | IP Address | Port | IP Address | Port | | +------+----------------------+--------+-----------------------+--------+----------------------------------+ | TCP | 181.110.171.21 | 21807 | 10.0.0.5 | 32400 | Plex Media Server | | UDP | 181.110.171.21 | 25911 | 10.0.0.6 | 25911 | Skype UDP at 10.0.0.6:25911 (2693)| | TCP | 181.110.171.21 | 25911 | 10.0.0.6 | 25911 | Skype TCP at 10.0.0.6:25911 (2693)| | TCP | 181.110.171.21 | 1700 | 10.0.0.6 | 1600 | Open.Nat Testing | +------+----------------------+--------+-----------------------+--------+----------------------------------+ [Removing TCP mapping] 181.110.171.21:1700 -> 127.0.0.1:1600[Done] [SUCCESS]: Test mapping effectively removed ;) Press any kay to exit...
OpenNat - Information > Initializing OpenNat - Information > StartDiscovery OpenNat - Information > Searching OpenNat - Information > Searching for: UpnpSearcher OpenNat - Information > UPnP Response: Router advertised a 'WANPPPConnection:1' service!!! OpenNat - Information > Found device at: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0OpenNat - Information > 10.0.0.2:5431: Fetching service list OpenNat - Information > 10.0.0.2:5431: Parsed services list OpenNat - Information > 10.0.0.2:5431: Found service: urn:schemas-upnp-org:service:Layer3Forwarding:1OpenNat - Information > 10.0.0.2:5431: Found service: urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1OpenNat - Information > 10.0.0.2:5431: Found service: urn:schemas-upnp-org:service:WANPPPConnection:1OpenNat - Information > 10.0.0.2:5431: Found upnp service at: /uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1OpenNat - Information > 10.0.0.2:5431: Handshake Complete OpenNat - Information > UpnpNatDevice device found. OpenNat - Information > ---------------------VVV EndPoint: 10.0.0.2:5431Control Url: http://10.0.0.2:5431/uuid:0000e068-20a0-00e0-20a0-48a802086048/WANPPPConnection:1Service Description Url: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0Service Type: urn:schemas-upnp-org:service:WANPPPConnection:1Last Seen: 15/05/2014 10:43:23 p.m. It got it!! The external IP Address is: 186.108.237.5OpenNat - Information > UPnP Response: Router advertised a 'WANPPPConnection:1' service!!! OpenNat - Information > Found device at: http://10.0.0.2:5431/dyndev/uuid:0000e068-20a0-00e0-20a0-48a8000808e0OpenNat - Information > Already found - Ignored
評論
圖片
表情
