@esiao so I attempted (socket io is brand new to me) to follow the socket io tutorial you provided me but I can't seem to get it working. If you're willing to help me out some more here's what I have.
Running NodeBB on 127.0.0.1:4567
Running 'Chat' application on 127.0.0.1:3000
'Chat' index.js
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendfile('index.html');
});
io.on('connection', function(socket){
console.log('a user connected');
});
http.listen(3000, function(){
console.log('listening on *:3000');
});
'Chat' index.html
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://127.0.0.1:4567');
socket.emit('something_custom', 'message');
</script>
Added this line to NodeBB's '/src/socketio/index.js'
socket.on('something_custom', function(msg) {
console.log('worked!');
});
I keep getting this error "XMLHttpRequest cannot load 127.0.0.1:4567/socketio/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:3000 is therefore not allowed access.