I am working on a chat server and it's working fine on local but whenever I try to run the project using ngrok then me and my friend are unable to chat.
var socket = io('http://localhost:7777', {
query: {
username: '<%= user %>'
}
});
Can anyone guide me how to make this public? Because the IP address changes everytime when connected to internet.
and
var app = express();
const chatServer = require('http').createServer(app);
chatServer.listen(7777);
I'm working in node.js for the first time
If your server and client do work locally, as you mention, you have some additional challenges when running the server and client on different machines over the internet: