Java TCP / IP服务器 - 通过Internet进行客户端通信 [英] Java TCP/IP Server - Client Communication over the internet
问题描述
我想通过互联网获得tcp / ip连接。我已经有两个类,一个处理请求的tcpserver和一个连接,发送和接收数据的tcpclient。
I'd like to get a tcp/ip connection working over the internet. I already have two classes, one tcpserver which handles requests and a tcpclient which connects, sends and receives data.
到目前为止,我已经在本地网络上完美运行了。通常的127.0.0.1 / localhost和我的192.168.xxx.xxx地址没有给出任何问题。
Until now I had it working perfectly on local networks. The usual 127.0.0.1 / localhost and my 192.168.xxx.xxx adresses are not giving any problems.
我的问题是,我该怎么办才能让它工作在互联网上。因为我可能想要做一些涉及简单的http /服务器的研究,我需要这个工作。
My question is, what do I have to do to make it work over the internet. As I might want to do some research involving a simple http/server I need this to work.
我怀疑它是我的防火墙,但可能是阻止这种类型的ISP连接。有人有想法吗?
I doubt its my firewall but maybe its the ISP that blocks this type of connection. Anybody has an idea?
推荐答案
您需要在路由器中打开一个端口,该端口通向服务器正在侦听的端口。然后,您连接到您的公共IP。此IP可在 http://www.visaminip.se/ 上找到
You need to open a port in the router that leads to the one that the server is listening on. You then connect to your public IP. This ip can be found on http://www.visaminip.se/
这篇关于Java TCP / IP服务器 - 通过Internet进行客户端通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!