Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

socket.io

16 views
Skip to first unread message

jbc

unread,
Aug 18, 2014, 8:17:10 PM8/18/14
to dev...@lists.mozilla.org
Hello.
I tested socket.io in firefoxOS 1.3 on GP Keon.
But. socket.io doesn't work.
Thank you.

Salvador de la Puente González

unread,
Aug 19, 2014, 2:53:32 AM8/19/14
to jbc, dev...@lists.mozilla.org
On 19/08/14 02:17, jbc wrote:
Hello.
I tested socket.io in firefoxOS 1.3 on GP Keon.
Can you elaborate? Paste the code, explain what is not working...

But. socket.io doesn't work.
Thank you.
Cheers!


_______________________________________________
dev-b2g mailing list
dev...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g




Este mensaje y sus adjuntos se dirigen exclusivamente a su destinatario, puede contener información privilegiada o confidencial y es para uso exclusivo de la persona o entidad de destino. Si no es usted. el destinatario indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización puede estar prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

The information contained in this transmission is privileged and confidential information intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this transmission in error, do not read it. Please immediately reply to the sender that you have received this communication in error and then delete it.

Esta mensagem e seus anexos se dirigem exclusivamente ao seu destinatário, pode conter informação privilegiada ou confidencial e é para uso exclusivo da pessoa ou entidade de destino. Se não é vossa senhoria o destinatário indicado, fica notificado de que a leitura, utilização, divulgação e/ou cópia sem autorização pode estar proibida em virtude da legislação vigente. Se recebeu esta mensagem por erro, rogamos-lhe que nos o comunique imediatamente por esta mesma via e proceda a sua destruição

jbc

unread,
Aug 19, 2014, 6:25:49 AM8/19/14
to Salvador de la Puente González, dev...@lists.mozilla.org

jbc

unread,
Aug 19, 2014, 6:44:22 AM8/19/14
to Salvador de la Puente González, dev...@lists.mozilla.org
Or more simple:

server:

app.js

var http = require('http');
var fs = require('fs');

var server = http.createServer( function(req, res) {
    fs.readFile('./index.html', function(error, data) {
        res.writeHead(200, { 'Content-Type': 'text/html' });
        res.end(data, 'utf-8');
    });
}).listen(3000);

var io = require('socket.io').listen(server);

io.sockets.on('connection', function(socket) {
    socket.emit('mensaje', { text: 'hola' });
});


index.html

<script src="/socket.io/socket.io.js"></script>
<script>
     var socket = io.connect();
    socket.on('mensaje', function(data) {
        alert(data.text);
    });
</script>


run: node app.js

Axel Hecht

unread,
Aug 19, 2014, 6:52:34 AM8/19/14
to mozilla...@lists.mozilla.org
Just tested with my phone and master, and that worked. It did crash the
phone, though.
https://crash-stats.mozilla.com/report/index/1bc1a838-891f-4ebd-9039-874542140819
is the crash report.

Axel

On 8/19/14 12:25 PM, jbc wrote:
> http://socket.io/demos/chat/
>
>
> 2014-08-19 8:53 GMT+02:00 Salvador de la Puente González
> <salvador.dela...@telefonica.com
> <mailto:salvador.dela...@telefonica.com>>:
>
> On 19/08/14 02:17, jbc wrote:
>> Hello.
>> I tested socket.io <http://socket.io> in firefoxOS 1.3 on GP Keon.
> Can you elaborate? Paste the code, explain what is not working...
>
>> But. socket.io <http://socket.io> doesn't work.
>> Thank you.
> Cheers!
>>
>>
>> _______________________________________________
>> dev-b2g mailing list
>> dev...@lists.mozilla.org <mailto:dev...@lists.mozilla.org>
>> https://lists.mozilla.org/listinfo/dev-b2g
>
>
> ------------------------------------------------------------------------

jbc

unread,
Aug 19, 2014, 9:54:09 AM8/19/14
to jose llopis, Mozilla Developer
Hi Jose : )
do you refer to
var socket = io.connect();
?
it isn't necessary if index.html is served by node.js


2014-08-19 15:33 GMT+02:00 jose llopis <josel...@yahoo.es>:

You have to include the socket.io.js client and point to your socket.io server URL



From: jbc <jav...@gmail.com>;
To: <dev...@lists.mozilla.org>;
Subject: [b2g] socket.io
Sent: Tue, Aug 19, 2014 12:17:10 AM

Hello.
I tested socket.io in firefoxOS 1.3 on GP Keon.
But. socket.io doesn't work.
Thank you.

Kartikaya Gupta

unread,
Aug 19, 2014, 9:58:16 AM8/19/14
to Axel Hecht
I filed bug 1055532 for this crash. Should be an easy fix.

jose llopis

unread,
Aug 19, 2014, 10:01:34 AM8/19/14
to jbc, Mozilla Developer

You need a script tag pointing to your socket.io client js and then connect your client

Enviado desde Yahoo Mail con Android



From: jbc <jav...@gmail.com>;
To: jose llopis <josel...@yahoo.es>;
Cc: Mozilla Developer <dev...@lists.mozilla.org>;
Subject: Re: [b2g] socket.io
Sent: Tue, Aug 19, 2014 1:54:09 PM

Hi Jose : )
do you refer to
var socket = io.connect();
?
it isn't necessary if index.html is served by node.js
2014-08-19 15:33 GMT+02:00 jose llopis <josel...@yahoo.es>:

You have to include the socket.io.js client and point to your socket.io server URL


From: jbc <jav...@gmail.com>;
To: <dev...@lists.mozilla.org>;
Subject: [b2g] socket.io
Sent: Tue, Aug 19, 2014 12:17:10 AM

Hello.
I tested socket.io in firefoxOS 1.3 on GP Keon.
But. socket.io doesn't work.
Thank you.

0 new messages