如何使客户端-服务器在Internet上运行? [英] How make Client - Server run over internet?

查看:55
本文介绍了如何使客户端-服务器在Internet上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我正在使用的当前应用程序是客户端-服务器"应用程序,并且在网络上运行良好.现在,我在考虑它是否可以在互联网上运行.问题是如何做到这一点?如何在我的计算机上启动服务器,在什么情况下才能使Internet上的每个客户端连接到服务器?我需要什么软件来执行此操作?

每个想法/建议都可能非常有用.

谢谢.

Hi friends,

The current application that I''m working on is a Client - Server application and work very well on a network. Now I''m thinking if it can run over the internet. The question is how to do this? How can I start the Server on my computer and in what circumstances so that every Client over the internet to connect to? What software I need to do this?

Every idea/advice can be very useful.

Thank you.

推荐答案

从作为客户端服务器应用程序的简单聊天应用程序中获取示例,您可以编写服务器程序来侦听计算机上的特定端口. .您将在这里面临的问题是,网络中的每个人都可以使用网络的内部IP地址或您的计算机名称访问该端口,但是在外部,他们将无法访问该端口.为此,您必须将对外部IP的任何请求转发到服务器程序正在侦听的端口.当然,仅当您可以使用管理员权限访问路由器管理页面并进行端口转发时,才可以执行此操作.每个路由器都有一个内部IP地址和一个外部IP地址.

您可以类似地将您的机器用作网络服务器来为Web应用程序提供网页.人们,如果我错了,请随时纠正我!

干杯
Taking example from a simple chat application that is a client-server app, you can write the server program to listen to a specific port on your computer. The problem you would face here is that everyone within your network would be able to access that port using the internal IP address of the network or your computer name but externally they won''t be able to. For that, you would have to forward any requests to the external IP to the port where your server program is listening. Ofcourse, you would only be able to do this if you can access the router administration page with admin rights and do the port forwarding. Every router has an internal IP address and an external IP address.

You can similarly use your machine as a web server to serve web pages for a web-app as well. Please feel free to correct me if I am wrong, people!

Cheers


这篇关于如何使客户端-服务器在Internet上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆