Socket.io not working on ubuntu server but working in localhost

const Server = use(‘Server’)

const io = use(‘socket.io’)(Server.getInstance())

const socketObj=use(‘App/Controllers/Http/mobile/SocketController’);

const _RL =use(‘App/Helpers/ResponseLibrary’);

var jwt = require(‘jsonwebtoken’);

const Env = use(‘Env’)

io.on(‘connection’, function (socket,callback) {
console.log(socket.id);
}})

check if you have the ports open in your server.

Yes. 3333 port is open and API’s are working but socket is not working