Skip to content Skip to sidebar Skip to footer

Can Not Debug Webapp On An Android Phone Using Port-forwarding

I have a web app with service worker that is served from my Desktop, and I want to debug on an Android phone (Pixel3). On the desktop I'm using localhost which satisfies the secure

Solution 1:

I was not able to use port-forwarding. Although it was working the network is extremely slow making this unusable option.

I finally solved the problem by doing the following things:

  • in the web server (nginx) config file:

    • configured an arbitrary port (8079) which is different than the default 80

      cat nginx.conf server {
      listen 8079;
      listen [::]:8079;
      ...

    • disabled https configuration

    • disabled redirect from http to https

  • in Chrome on the Desktop in chrome://flags/
    Configured the parameter: Insecure origins treated as secure with: http://192.168.1.74:8079
    Enabled and relaunched Chrome

  • in Chrome on the Android
    set similar settings as for Chrome on the Desktop and relaunched

After doing that I can debug the web app from my Android phone, and the service worker is registered, installed, and used.


Post a Comment for "Can Not Debug Webapp On An Android Phone Using Port-forwarding"