Home > Mobile >  How to receive http request on my local machine from the remote device on the internet?
How to receive http request on my local machine from the remote device on the internet?

Time:01-15

I am developing an app to learn serverside. I have created a node js server and an android app.

WorkFlow⚙️(What I want to achieve):- WorkFlow

My local IP of pc: 192.168.0.120

On the port I am listening:8443

The whole thing working fine in localhost: as I am sending POST req. on 192.168.0.120:8443 on clicking the button on my app.

But this will only work if I am connected to my wifi not when connected to the SIM network or somewhere remote location.

So my question is where to send a request by clicking the button in my app (definitely can't send on 192.168.0.120:8443 as I am won't be connected to wifi)?

server.js file

    let http = require('http')
    
    let server = http.createServer(function (req, res) {
        if (req.method === 'POST') {
            console.log('sleeping..           
  •  Tags:  
  • Related