从Android的访问本地主机通过WiFi [英] accessing localhost from android over wifi

查看:168
本文介绍了从Android的访问本地主机通过WiFi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了HTTPS的web服务,所以它使用SSL加密。

I have written a Https webservice, so it is encrypted with SSL.

有关测试我想存取权限的Web服务通过WiFi。

For testing i would like to acces that webservice over wifi.

修改示例:我的web服务上的虚拟机号111运行,我想它存取权限通过WiFi这样的联系地址是的 HTTPS://VM111/Webservice/service.svc 。我可以从任何电脑存取权限它在WiFi网络,但没有从Android手机,那就是我的问题。

edit Example: My webservice is running on a VM number 111, i want to acces it over wifi so the adress would be https://VM111/Webservice/service.svc. I can acces it from any laptop in the wifi network but not from the Android Phone, that is my problem.

有没有办法来存取权限的虚拟机的本地主机,从Android手机,以及有没有人处理过?

Is there a way to acces the localhost of the VM, from the Android phone, and has anyone dealt with this before?

我客串是有事情做与领域,因为所有其他设备在Active Directory中。

My gues is that is has something to do with domains because every other device is in the Active directory.

如果有关于我的问题,我很高兴回答任何问题,

If there are any questions about my question i am glad to answer them,

推荐答案

您可以得到一个公用URL本地主机上的特定端口上运行的服务器。

You can get a public URL for your server running on a specific port on localhost.

在我工作的地方,我可以用我的机器的本地IP地址的应用程序访问本地服务器,因为大多数其他的答案建议。但是在家里我是不是能够做到这一点的某些原因。在尝试很多答案,并花很多时间,我碰到 https://ngrok.com 。这是pretty的直线前进。单从文件夹中下载它做的:

At my work place I could access the local server by using the local IP address of my machine in the app, as most of the other answers suggest. But at home I wasn't able to do that for some reason. After trying many answers and spending many hours, I came across https://ngrok.com. It is pretty straight forward. Just download it from within the folder do:

ngrok portnumber

(在Windows命令提示符)

( from command prompt in windows)

./ngrok portnumber

(从Linux终端)

(from terminal in linux)

这会给你一个公用URL对本地主机的端口号上运行的本地服务器。您可以在您的应用程序,并使用该URL调试。

This will give you a public URL for your local server running on that port number on localhost. You can include in your app and debug it using that URL.

您可以安全地暴露本地Web服务器到互联网,并捕获所有流量进行详细检查。您可以与您的同事开发者也谁可能被远程工作,可以调试应用/服务器的交互共享的URL。

You can securely expose a local web server to the internet and capture all traffic for detailed inspection. You can share the URL with your colleague developer also who might be working remotely and can debug the App/Server interaction.

希望这样可以节省别人的时间一天。

Hope this saves someone's time someday.

这篇关于从Android的访问本地主机通过WiFi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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