How to include cookies of custom domain in http requests from mobile browsers to a local server?

279 views Asked by At

I am developing a web application which until now was targeted to desktop-browsers only. The client interacts with a backend that requires a cookie of a specific domain (e.g. "my.app.com").

For development, I run both client and backend locally on my machine. Until now, to make the client include the required cookie when sending http requests to the backend, I modified the hosts file to map "my.local.app.com" to localhost - it works well.

Now I want to debug my app on mobile browsers (Android and iPhone) - which are connected to the same wifi as the machine. For that, I need the devices to map "my.local.app.com" to my machine address (again, so the client http requests to the local backend includes the requested cookie).

Ideas I have rejected:

  • Edit hosts file in Android/iOS - Not possible without root.
  • Set up a local DNS server on my machine, and set it as static DNS for the mobile devices - Not possible (at least for Android, and I think for iOS as well), as android requires DNS over TLS server.

Any suggestions on how to achieve this?

Thanks.

0

There are 0 answers