That's not how you usually do it. Instead you have something sitting between the device and the backend.
Historically I've used Charles Proxy for some things:
Charles Web Debugging Proxy - Official Site
www.charlesproxy.com
Currently I'm using ngrok:
ngrok is developer infrastructure that routes and secures traffic to your apps, APIs, and AI models, wherever they run. Start on localhost, ship to prod.
ngrok.com
The latter might seem complicated, but once you install it, it's almost dead simple to use.
There are many alternatives to the two above: