我打算使用STUN作爲我的遍歷NAT解決方案,並且遇到了JSTUN。雖然我已搜查以防萬一計算器,我發現提到JSTUN這個帖子有其源內部文檔:Java and Which Stun libraries i should use?有沒有人有JSTUN文檔或幫助解釋更多?
然而,http://javawi.de/源被打破,然後我找到了另一種方式來下載JSTUN代碼https://github.com/tking/JSTUN
所以我在這裏要求的文件,如果有人會給我,並想知道它是如何工作的:
1.de.javawi.jstun.test.demo.StunServer要求我提供2個IP和端口。在我看來,STUN服務器是提供「打洞」服務的一種方式,爲什麼它需要2個IP和端口?
2.運行de.javawi.jstun.test.demo.DiscoveryTestDemo後,它返回我的IP,這是什麼意思?
No route to host
java.io.IOException: No route to host
No route to host
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:625)
at de.javawi.jstun.test.DiscoveryTest.test1(DiscoveryTest.java:96)
at de.javawi.jstun.test.DiscoveryTest.test(DiscoveryTest.java:64)
at de.javawi.jstun.test.demo.DiscoveryTestDemo.run(DiscoveryTestDemo.java:48)
at java.lang.Thread.run(Thread.java:680)
java.io.IOException: No route to host
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:625)
at de.javawi.jstun.test.DiscoveryTest.test1(DiscoveryTest.java:96)
at de.javawi.jstun.test.DiscoveryTest.test(DiscoveryTest.java:64)
at de.javawi.jstun.test.demo.DiscoveryTestDemo.run(DiscoveryTestDemo.java:48)
at java.lang.Thread.run(Thread.java:680)
Network interface: en0
Local IP address: 192.168.1.23
Result: Port restricted Cone NAT handles connections.
Public IP address: 116.48.14.100
問候,
史蒂夫
down-vote for what? – Dexter