如何避免设置端口转发

huangapple go评论60阅读模式
英文:

How to avoid to have to set port forwarding

问题

我正在用Java编写一个程序,它允许发送文件的丰富客户端。
因此,从具有公共IP(称为pip1)的LAN 1,第一个丰富客户端(fc1)具有本地IP(lip1),将文件通过WAN发送到LAN 2上的第二个丰富客户端(fc2)(pip2)。
我使用TCP/IP协议在端口8081上进行通信。因此,只有在LAN1的路由器上为lip1转发端口8081,并且在LAN2的路由器上为lip2转发端口8081,它才能正常工作...

这实在太糟糕了:我想你已经明白我在网络方面不太擅长。:s
您有什么建议吗?我正在使用java.net.ServerSocket

英文:

I'm programming a fat client in Java that permits sending files.
So from LAN 1 with public IP (so called pip1), a first fat client (fc1) with local IP (lip1) sends a file to a second fat client (fc2) on LAN 2 (pip2) via WAN.
I use the protocol TCP/IP on port 8081. So it is working only if I port-forward the port 8081 for lip1 on LAN1's router and with the port 8081 for lip2 on LAN2's router...

It is awful: I guess you have understood I'm not good with network stuff. :s
What is your suggestion? I use java.net.ServerSocket

答案1

得分: 0

嗯,我想我在这个主题上的研究还不够。:s 我在这里找到了许多想法:

英文:

Hmm, I guess I didn't research enough on the topic. :s I have found many ideas here:

huangapple
  • 本文由 发表于 2020年9月2日 19:35:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/63704677.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定