I've got a problem to run the server with socketIO module on AWS EC2 server. My current code:
const port = process.env.PORT || 8080;
var server = require('http').Server();
var io = require('socket.io')(server);
const socketioHandler = require(backPath + 'functions/socketioHandler');
socketioHandler.ioConnections(io);
server.listen(port, 'ec2-IP_XXX.compute-1.amazonaws.com');
And the URI that I'm using to connect client to the server:
ec2-IP_XXX.compute-1.amazonaws.com:8080
It seams that for some reason the client cannot find the server.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.