tuding
V2EX  ›  Android

Android 手机上可以搭建本地 httpServer 吗?

  •  
  •   tuding · Oct 30, 2022 · 15666 views
    This topic created in 1486 days ago, the information mentioned may be changed or developed.

    如题, 想在 Android 手机上安装一个 http 服务器, 指向到手机上的某个目录, 就是 html+css+js, 不需要 php 数据库那些, 有现成的方案吗?

    最好是傻瓜一点的, 简单设置一下就可以

    手机没有 root

    14 replies  •  2022-11-21 16:52:56 +08:00
    Aloento
    Aloento
    Oct 30, 2022
    1
    当然可以,X-plore File Manager 都能做到类似功能
    可以考虑写个小 App
    tuding
    tuding
    OP
    Oct 30, 2022
    2
    @Aloento #1 写不来, 没学过
    X-plore File Manager 这个安装上了可以 http://127.0.0.1 访问吗?
    Ayahuasec
    Ayahuasec
    Oct 30, 2022 via Android❤️2
    3
    可以装个 termux 然后 apt-get 随便装个 http server 就行了,比如 nginx 、apache ,或者不想写配置的话装个 python3 然后用 http.server 模块( python3 -m http.server --bind 127.0.0.1 8080 )
    没有 root 的话不能绑定低端口,绑一个 1024 以上的高端口就行了。
    另外就是用比较新版本的安卓的话,可能会在锁屏的时候杀开放端口连接的后台应用。
    darkengine
    darkengine
    Oct 30, 2022
    4
    如果只是提供静态页面给本 app 展示,可以试试用
    webview.loadURL("file:///data/data/com.yourproject.example/files/index.html");
    连 http 服务器都不用起。
    tuding
    tuding
    OP
    Oct 31, 2022
    6
    @Ayahuasec #3 much appreciated.
    elementp
    elementp
    Oct 31, 2022
    7
    Mixplorer https://mixplorer.com/
    启用 http 服务器
    yolee599
    yolee599
    Oct 31, 2022 via Android
    8
    KSWEB
    opengps
    opengps
    Oct 31, 2022
    10
    直接安装个旧手机工具箱,有你要的静态网页服务器功能
    kebing1011
    kebing1011
    Oct 31, 2022
    12
    试试 Andorid 爱传送 app
    mtdhllf
    mtdhllf
    Nov 1, 2022
    13
    买个服务器,几十块钱不贵,静态网站也简单,再装个宝塔面板,网页直接拖进去就行了
    stcode
    stcode
    Nov 21, 2022
    14
    KSWEB 完美实现
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4367 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 06:55 · PVG 14:55 · LAX 22:55 · JFK 01:55
    ♥ Do have faith in what you're doing.