hi people
I try to use socket.io but I have this error
XMLHttpRequest cannot load
http://localhost:7070/socket.io/1/?t=1346294690161. Origin null is not
allowed by Access-Control-Allow-Origin.
this is my code:
server.js
var io = require('socket.io').listen(7070);
io.sockets.on("connection", function arranque(cliente){
cliente.on("nuevoMensaje", function emitir(dato){
io.sockets.emit("MensajeDesdeServidor", dato );
console.log("mensaje de un cliente" + dato)
});
});
client:
<script src="http://localhost:7070/socket.io/socket.io.js"></script>
$(document).on('ready', function(){
var websocket = new io.connect("http://localhost", {port: 7070});
//websocket.on("nombreDesdeServidor", function(datoServidor){
// $("#formulario label").text("Acaba de entrar" + datoServidor);
//});
});
if you can help me, thanks
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en