简体   繁体   English

在本地网络上的差异计算机上访问客户端和服务器应用

[英]Accessing client and server app on diff machine on local network

I want to route client app requests coming from a different machine on my local network, to the server on my dev machine. 我想将来自本地网络上另一台计算机的客户端应用程序请求路由到开发计算机上的服务器。

I have a client side app running on port 8080, and a server app running on port 3000. 我有一个在端口8080上运行的客户端应用程序,以及在端口3000上运行的服务器应用程序。

I am accessing the client app from another machine on the local network using: 我正在使用以下方法从本地网络上的另一台计算机访问客户端应用程序:

machineName:8080

However, the requests from the client app are obviously all being sent to localhost:3000 rather than machineName:3000 . 但是,来自客户端应用程序的请求显然都被发送到localhost:3000而不是machineName:3000

How do I fix this issue? 如何解决此问题?

我必须按照以下步骤在客户端应用程序上转发API请求:

'http://' + window.location.hostname + ':3000'

暂无
暂无

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

相关问题 访问客户端本地网络上的文件,但不能从 Web 服务器访问本地计算机 - Access files on clients local network but not local machine from web server 通过浏览器中的客户端JavaScript在本地网络中查找服务器 - Find a server in local network via client javascript in browser 客户端包括在本地计算机上 - Client side includes on local machine 通过 phonegap 应用程序从同一网络中的移动设备与本地服务器通信 - Communicate with local server from a mobile in the same network through a phonegap app 本地网络上的其他人如何在我的机器上运行时访问我的 NodeJS 应用程序? - How could others, on a local network, access my NodeJS app while it's running on my machine? 从本地网络访问Webpack Dev Server? (在移动设备上实现热重新加载) - Accessing Webpack Dev Server from local network? (React Hot Reloading on mobile) 是否可以在客户端启动测试框架以测试本地网络中的其他应用 - Is possible Launching testing framework on client side to test other app in local network 在本地网络上查找特定服务器 - Find a specific server on the local network 使用 JS 服务器时间而不是客户端时间来避免这种行为,即用户可以通过更改本地机器时钟来操纵结果 - Using JS server time instead of client time to avoid this behavior where users can manipulate results by changing their local machine clock 本地计算机上的Web服务器,有任何陷阱吗? - Web server on local machine, are there any gotchas?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM