Htpplistener没有通过Lan工作! [英] Htpplistener not working via Lan!

查看:104
本文介绍了Htpplistener没有通过Lan工作!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在开展一个项目。我有一个Android客户端应用程序和基于C#的WebServer应用程序。我使用HttpUrlConnection从服务器请求数据并使用HttpListener响应Android。我尝试用java桌面应用程序请求它工作正常。但是我尝试在android上它不起作用。我的前缀是http:// 127.0.0.1:8080 /。我将前缀更改为http://www.google.com.tr并且有效。这两个应用程序通过wifi共享相同的Internet网络,我得到连接超时错误。有什么问题?



注意:我在管理员模式下运行应用程序并使用netsh http add urlacl命令添加了网址预留

Hi I am working on a project. I have a Android Client App and C# Based WebServer App. I use HttpUrlConnection to request data from server and use HttpListener to response to Android. I tried to request with a java desktop app it works fine.But then i tried on android it is not work. My prefix is "http : //127 . 0 . 0 . 1:8080/". I changed prefix as "http://www.google.com.tr" and it worked. These two applications are sharing the same Internet Network over wifi and i get "Connection Timeout Error". What is the problem?

Notes : I run app on Administrator Mode and I added url reservation with "netsh http add urlacl" command

推荐答案

127.0.0.1是本地机器的环回地址,你应该在你的Android设备上使用服务器机器的局域网地址。



在服务器上运行cmd.exe并键入ipconfig以查看服务器的IP地址。
127.0.0.1 is a loopback address for the local machine, you should be using the server machines lan ip address instead on your android device.

run cmd.exe on your server and type ipconfig to see what your server's ip address is.


您好我解决了问题。

点击此处获取资讯


这篇关于Htpplistener没有通过Lan工作!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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