简体   繁体   English

如何从一台计算机访问同一网络上的另一台计算机的本地主机服务器

[英]How to access a localhost server from one computer to another on the same network

I have a spring boot application (Spring Web) which has a tomcat server embedded into it (maven dependency). 我有一个Spring Boot应用程序(Spring Web),其中嵌入了一个tomcat服务器(maven依赖项)。 The application is a server and consists of several HTTP routes. 该应用程序是一台服务器,由几个HTTP路由组成。 This application is on my laptop. 该应用程序在我的笔记本电脑上。 I would like to execute the application on my laptop, and be able to RESTful calls (eg GET, POST etc) to the server. 我想在笔记本电脑上执行该应用程序,并能够对服务器进行RESTful调用(例如GET,POST等)。 How can I make requests to the server from my computer? 如何从计算机向服务器发出请求?

I've checked out several tutorials and they tend to use XAMP or another similar application so not sure on how to go about this. 我已经检查了几个教程,他们倾向于使用XAMP或其他类似的应用程序,所以不确定如何去做。 Thank you. 谢谢。

Once your war is deployed on your server, you can send any REST call to it using curl, a browser, or my personal favorite for testing is Postman as it circumvents cross-domain issues. 一旦您的战争部署在服务器上,您就可以使用curl,浏览器或我个人最喜欢测试的REST呼叫来发送任何REST呼叫,因为Postman可以绕过跨域问题。

To make the REST call simply use the IP address of the server instead of localhost. 要进行REST调用,只需使用服务器的IP地址而不是localhost。 You can get the IP address of the machine using ifconfig or whatsmyip.org 您可以使用ifconfig或whatsmyip.org获取计算机的IP地址。

http://<IP address>/...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过网络从计算机2连接到位于计算机1上的mysql服务器? - How to connect to mysql server located on computer 1 from computer 2 through the network? 如何使用Java通过网络将文件从一台计算机传输到另一台计算机? - How to transfer files from one computer to another over the network using Java? 如何在同一个应用服务器上从一只耳朵访问另一只耳朵的方法 - how to access method from one ear to another ear on same app server 如何从一个类到同一包的另一个类访问一个变量 - How to access one variable from one class to another of the same package 如何将对象从一台计算机发送到另一台计算机? - How to send an Object from one computer to another? 如何从另一台计算机连接到SQL Server - How to connect to a sql server from another computer 如何从另一台计算机访问 WildFly 12 服务器上的 web 应用程序? - How can I access a webapp on WildFly 12 server from another computer? 宁静的Web服务运行在localhost apache tomcat上,如何通过Internet从其他计算机访问 - Restful Web services run on localhost apache tomcat, how to access from other computer over internet 我如何将数据从一个Couchbase服务器(localhost)迁移到另一台服务器(34.xx.xxx.xx) - How can i migrate data from one Couchbase server(localhost) to another server(34.xx.xxx.xx) 如何在网络上访问localhost:8080? - How to give access to localhost:8080 on network?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM