Ok Ok
Ok Ok

Reputation: 1

How can I fix the backend connection issue for my React and Node chat system on my phone?

I have a simple react and node chat system built, which uses web sockets. when I tried to access with computers ip adress from my phone it showed me front-end but for some reason backend was not working. I would be thankful to everyone who would answer me.

P.S both frontend and backend works fine in laptop where I run localhost from.

I tried connecting cors and turning off firewall as well as restarting everything mobile,computer, wifi router but didn't work

Upvotes: 0

Views: 275

Answers (1)

Bishakh Ghosh
Bishakh Ghosh

Reputation: 1258

Perhaps within the frontend you are putting the url localhost to make api calls to the backend. Instead of localhost you may want to put the computer's public address.

In order to quickly test you may start a tunnel in your laptop and use that public URL to access. You can use something like https://pinggy.io or ngrok to do that.

Upvotes: 0

Related Questions