使我的 TCP 服务器面向 Internet - 我应该从哪里开始?
我写了一个客户端/服务器代码。 服务器程序在终端上执行,该终端明确地从客户端接收文本数据,并且客户端是一个 GUI,您可以在其中指定运行服务器的计算机的 IP 地址。
然而,这仅适用于封闭网络(LAN)。 我刚刚学习了 TCP IP,并编写了一些在 LAN 上运行的代码。 我想让这个程序在网络上运行(通过互联网)。 但我有一些基本的疑问,例如,是否需要本地 ISP 的许可才能使此类程序在互联网上执行。是否涉及购买域名或某种权限? 有人可以帮我吗,我应该做什么,或者我应该从哪里开始?
I have written a client/server code.
The server program executes on a terminal which plainly receives text data from the client and the client is a GUI where in you could specify the IP address of the machine where the server would be running.
However this works only in a closed Network(LAN).
I have just learnt TCP IP and have written a few codes that run on a LAN.
I wanted to make this program work across the network(over the internet).
But I have some basic doubts like,does one need the permission of the local ISP for such programs to execute across the internet.Does it involve buying a domain or some kind of permissions?
Can some one please help me on,what should I be doing,or where should I start from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
侦听器必须以某种方式打开 IP 端口。如果您位于路由器后面,您应该在路由器上设置正确的端口转发,如果 ISP 提供自己的子网,您应该知道如何设置此类链接。 (我不知道 ISP 可能会使用哪种技术)。
一开始,您不需要拥有自己的域名,但您应该能够通过 ip 进行寻址。如果您需要域名,请注册自己的域名或免费创建子域名(我使用的是 http://freedns.afraid.org/ )
Listener have to have IP port opened in some way. If you are behind router, you should set proper port forwarding on router and if ISP provides its own subnet, you should know how to setup such link. (i do not know what kind of tehnology ISP might use for this).
For beginning you do not need you own domain name but you should be able to address by ip. If you need domain, register own domain name or create subdomain for free (i was using http://freedns.afraid.org/ )
如果您的服务器位于创建 LAN 的路由器后面,则必须配置路由器,使其将包从客户端转发到服务器。
您必须将特定端口上的所有传入包转发到服务器的本地 IP。
If your server is behind a router which creates a LAN, you have to configure the router that it will forward the packages from your client to the server.
You have to forward all the incoming packages at the specific port to the local ip of the server.