Open nicogaldo opened 6 years ago
we also face this issue.
In Chrome the connection goes to http://141.XX.XX.25/socket.io/ but on Android, it tries to connect to http://file/socket.io/
How can I change it?
This is my actual code and works.
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
io.on('connection', function(socket) {
socket.on('create notification', function( data ) {
socket.broadcast.emit('new notification', data);
});
});
var PORT = process.env.PORT || 8080;
//var PORT = 3000;
server.listen(PORT, ()=> {
console.log('Node/Express: \x1b[32m%s\x1b[0m', 'online - port: '+ PORT);
});
I made the deploy in Heroku, but what url should I configure?
app.module.ts (Angular hosted in other server)
app.js (node.js hosted in heroku server)
In chrome console get the error:
GET http://myapp-backend.herokuapp.com:55353/socket.io/?EIO=3&transport=polling&t=MEtzh25 0 ()