从工作站外部访问在 Eclipse 中运行的网络服务器 [英] Accessing webserver running within Eclipse from outside the workstation

查看:23
本文介绍了从工作站外部访问在 Eclipse 中运行的网络服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了一个 Web 项目,该项目旨在从 Eclipse 中本地部署到 Google Appengine.这样服务器就启动了,在浏览器中输入localhost:8080就可以正常访问了.到目前为止一切都很好.但我需要的是从外部访问它,比如从朋友的机器(显然位于同一个无线网络中).因此,当他键入以下 <my-notebook-ip-address>:8080 时,他应该访问本地运行的网络服务器(在 Eclipse 中).但这不起作用!

I run a web project targeted to be deployed on the Google Appengine locally from within Eclipse. So the server starts up and it can be accessed normally by typing localhost:8080 into some browser. Everything fine so far. But what I need is to access it from outside, say from a friend's machine (which obviously resides in the same wireless network). So when he types the following <my-notebook-ip-address>:8080 he should reach the locally running webserver (within Eclipse). But that doesn't work!

我需要这个的原因是我希望我的 Android 应用程序在我的笔记本电脑上的 Android 模拟器中运行,以访问我本地运行的网络服务器.这只能通过使用笔记本的真实 IP 地址来实现,因为 Android 上的 localhost 将是手机本身.

The reason I need this is that I want my Android app running on my notebook within the Android emulator to access my locally running webserver. This is just possible by using the notebooks real ip address since localhost on the Android will be the phone itself.

更多细节

  • Mac OSX 雪豹
  • 日蚀伽利略
  • 网络服务器:Google Appengine(在 Eclipse 中启动)

当从 Eclipse 中启动 Appengine 服务器时,我可以访问它:http://localhost:8080.
但是,我无法从我的本地笔记本(网络服务器在 Eclipse 中运行)访问它:http://192.168.0.5:8080 其中 IP 是我的 IP 地址在网络中.

When launching the Appengine server from within Eclipse I can access it with: http://localhost:8080.
I cannot access it however from my local notebook (where the webserver is running within Eclipse) with: http://192.168.0.5:8080 where the IP is my IP address in the network.

我已禁用所有防火墙!

推荐答案

不确定这是否适用于您的情况,但您可以使用 10.0.2.2 而不是从您的 Android 设备访问主机 PC本地主机.

Not sure if this applies to your situation, but you can access the host PC from your Android device with 10.0.2.2 instead of localhost.

参考

官方文档

这篇关于从工作站外部访问在 Eclipse 中运行的网络服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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