isobit/websocket-nats

websocket-nats halt firefox,seems a infinite loop

dbskccc opened this issue · 3 comments

firefox 49.0.2 on windows 10 x64/ubuntu 16.04 x64 with ws-tcp-relay connect to gnatsd
with a simple script below,firefox has no response when load page and memory increase quickly.
test with chrome /ie 11 is ok.
`<script>

nats_con=NATS.connect("ws://192.168.1.103:4223");
//console.log("nats_con:",nats_con);
nats_con.publish("foo","hello from websocket");
nats_con.subscribe("foo",function (msg) {
    console.log("msg:",msg)
});
console.log("script has exec finished");

</script>`

when i change to nats_con=NATS.connect({url:"ws://192.168.1.103:4223",yieldTime: 10});
now firefox show error: TypeError: i.stream.pause is not a function

Hm, interesting. This library needs some love as I haven't been actively using it lately. I'll take a look. I'll have to come up with some other solution for yieldTime since the WebSocket API doesn't support pause.

thanks, now it works well with v0.6.8