简体   繁体   English

在手机上运行角度PWA

[英]Run angular PWA on mobile

I turned my angular project into a pwa as described on https://angular.io/guide/service-worker-getting-started https://angular.io/guide/service-worker-getting-started所述,我将我的角度项目转换为pwa

When I start the server with 当我启动服务器时

http-server -p 8080 -c-1 dist/ http服务器-p 8080 -c-1 dist /

only the 只有

http://127.0.0.1:8080 http://127.0.0.1:8080

seems to be working and offers me to install the PWA. 似乎正在工作,并为我提供了安装PWA的方法。 When I try to access 当我尝试访问时

http://192.168.xxx.xx:8080 HTTP://192.168.xxx.xx:8080

there seems to be an issue with the secure origin, so I can't install the PWA. 安全来源似乎存在问题,因此我无法安装PWA。

any hints what I'm doing wrong? 有什么提示我做错了吗?

You're not doing anything wrong per se, One of the Requirements for making a PWA installable is by serving it over (https), 您本身并没有做错任何事情,使PWA可安装的要求之一是通过(https)提供服务,

And for development purposes the browser considers (127.0.0.1:) and (localhost:) to be secure domains, But other customised domains are not recognised, hence are treated as development servers that are not secured. 出于开发目的,浏览器将(127.0.0.1:)(localhost:)视为安全域,但是无法识别其他自定义域,因此将其视为不安全的开发服务器。 You should stick to 127.0.0.1 for the time being since it works, until you move to your potential Live secured server! 自从它起作用以来,您应该暂时坚持使用127.0.0.1,直到您移至潜在的Live受保护服务器为止!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM