Android设备上的强制门户 [英] Captive portal on android device
问题描述
我正在将我的android设备用作移动网络服务器.我想将通过我的便携式Android热点连接的每个用户定向到特定的欢迎页面.
I am using my android device as a mobile web server. I want to direct every user that connects through my portable Android hotspot to a specific wellcome page.
是否有人知道如何在我的设备中实施此技术(我相信这称为强制门户技术)?
Does anybody know how to implement this technique in my device (I believe this is called the captive portal technique)?
推荐答案
我回答了我自己的问题,直到有人分享一些有关如何在无根设备中实施强制门户的有用信息.
I answer my own question until someone shares some useful information on how to implement the captive portal in a non-rooted device.
目前,我还不知道这种可行的解决方案.
At the moment I am not aware of such working solution.
强制门户的工作原理是拦截大多数网络数据包(使用防火墙),而不管其地址或端口如何,直到用户打开浏览器并尝试访问Web为止.那时,浏览器被重定向到可能需要验证等的网页.
Captive portal works by intercepting most network packets (using a firewall), regardless of address or port, until the user opens a browser and tries to access the web. At that time the browser is redirected to a web page which may require authentication et.c.
因此,要存在专属的门户解决方案,许多部分(如软件防火墙/路由器/网络服务器)都需要集成和协作.鉴于目前无根电话中的限制/权限,我现在认为该应用程序不太可能存在.
So for a captive portal solution to exist, many parts like a software firewall/router/webserver need to integrate and cooperate. Given the current restrictions/permissions in a non-rooted phone, I now believe that such application won't likely exist.
@mmm2006: However, if you do have a rooted device there are apps like Paywall that can do the trick for you.
您还可以尝试实施自己的强制门户解决方案.这并非易事,但由于Android基于Linux内核,因此您可以尝试以下方法:
You can also try to implement your own captive portal solution. It's not trivial but since Android is based on the Linux kernel, you could try something like these:
- Captive Portal Using PHP and iptables Firewall on Linux
- Using iptables and PHP to create a captive portal
这篇关于Android设备上的强制门户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!