websocket

HTML5 WebSockets, onmessage event.data comparison

Hi everybody, i am working on an HTML5-Application which uses WebSockets. My WebSocketServer sends a message to the WebSocketClient. The Client should now, based on the received message, trigger an javascript function. Here is my example-code: socket.onmessage = function (event) { if (event.data == "someAction") { ...

HTML 5 Websockets will replace Comet?

It looks like Websockets in HTML 5 will become a new standard for server push. Does that mean the server push hack called Comet will be obsolete? Is there a reason why I should learn how to implement comet when Websockets soon (1-2 years) will be available in all major browsers? Then I could just use beaconpush or pusher instead till ...

Web sockets use a lot of resources like comet long polling?

I know that Comet long polling are bad for Web servers because they occupy one thread per connection. So you cannot have a lot of users with persistent connections or your web server will crash. Is this the same with web sockets in HTML 5? How could this solve the resource problem if it occupies one thread too per persistent connection...

path- and other problems using node.JS and Socket.IO

Hi, I'm using node.JS in VirtualBox on a TurnkeyLinux hosted by Windows. I was following the instructions here. node.JS is living in /root/node. Although I can run simple examples successfully I'm having a hard time figuring out certain things, cause I'm not a Linux-guy normally. I wanted to use socket.io. I managed installing node.JS...

Node.js Websockets Socket.IO

I can't get the client-side events to fire, please see the code/explanation: Okay, so I got this working(I think) Client-side code: <script src="./Socket.IO/socket.io.js"></script> <script> io.setPath('./Socket.IO/'); var socket = new io.Socket('jayz.danstanhope.webfactional.com', { 'port': 80 }); socket.on('connect', f...

Node.js web sockets server: Is my idea for data management stable/scalable?

Hi, I'm developing a html5 browser multi-player RPG with node.js running in the backend with a web sockets plug-in for client data transfer. The problem i'm facing is accessing and updating user data, as you can imagine this process will be taking place many times a second even with few users connected. I've done some searching and fou...

HTML5 Websocket only works on localhost

I followed the HTML5 Websocket tutorial of the website below: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ It worked well, then I changed the host value from "localhost:8080" to "218.175.192.160:8080" (my ip) in client-side page, the server side still kept "localhost:8080". It turns out that I ...

Minimum Websocket Nodejs Tail Example

I'm trying to create a stream of data to the browser using websocket. The data is the output of a log file. (tail -f filename) Using node js, I've manage to log into stdout, but I haven't been able to create the server and create the client (js/html) code to create a websocket and receive all the output of this child process. Can anyone ...

GWT support for HTML5

Hello Does GWT support HTML5? I mean especially Canvas and WebSockets? Regards ...

Opening a Socket.IO connection in a google chrome extension

Hi there, I'm trying to figure out how to open a connection to an external Socket.IO server every time the user visits a new page from a google chrome extension. This is my first extension, so it's a bit tough. I tried using an iframe and the history.onVisit event, but no luck so far. ...

pusherapp libraries

I'm using the pusherapp service which allows me to easily set up websocket apps. http://pusherapp.com/ To do this however, I need some server side code to interact with their service. http://pusherapp.com/docs/libraries I'm wondering if there's any reason to choose one lang/lib over another. I'm using PHP right now, I can easily swap...

How to access other client connections from a Go WebSocket handler?

Note: I'm more interested in understanding general Go concepts/patterns, rather than solving this contrived example. The Go (golang) WebSocket package provides a trivial echo server example, which condenses down to something like this: func EchoServer(ws *websocket.Conn) { io.Copy(ws, ws); } func main() { http.Handle("/echo", websock...

WebSocket server support

I'm new to WebSocket and HTML5. Before today, I thought that all the HTML5 standards affect only the clients(broswers); so assume that users have upgraded their broswers, its ready. But after some reading on WebSocket, it seems to me that I need to install something on the server to support it. Am I understand it right? As an example, i...

Websocket (javascript) vs Silverlight (ruby, python, javascript, c# etc)?

Just for clarification, is the question: websocket vs silverlight? Cause websocket is based on HTML enabling the web browser and web client to talk with each other live. Does this mean that developers cannot use Ruby/Python in client side, but only Javascript? If I use Silverlight, then it seems possibly for developers to use Ruby/Pyth...

Why are WebSockets without Sec-WebSocket-Key1 insecure?

The old and superseded draft 75 of WebSocket specification doesn't specify HTTP request headers Sec-WebSocket-Key1 and Sec-WebSocket-Key2. Why does the latest draft include these, and what in terms of increased security? ...

Why do we need web-sockets?

This is more of a n00b question, but I've never really known the answer. so why do we need the websockets protocol? and, what are the advantages over comet-style/long poll/hanging GET-style use of HTTP? ...

NodeJS WebSocket Handshake Silently Failing?

I'm trying to write a very simple websocket server in nodejs, and I'm running into an issue. On the browser, the the WebSocket.onclose function is the only one that is fired (onopen, onmessage, and onerror are not). I've tested in Chrome7 and FireFox4. Here's my server code: var http = require('http'), net = require('net'), crypto...

Using a Flash socket with Node.js

I've been using gimite / web-socket-js to implement a WebSocket past simply Chrome and development builds of Safari. I want to move away from the Ruby server and onto Node.js. Suddenly it doesn't work in anything but Chrome. I suspect that this has to do with the Flash Socket Policy file that I need to implement. I would like to implem...

How would I go about uniquely identifying a computer in node.js?

Simple question, I'm new to using node.js and was curious as to how I should uniquely identify a computer? ...

EventMachine Question

I'm working on creating a background script that uses EventMachine to connect to a server with WebSockets. The script will be run using DelayedJob or Resque. I've been able to get it to talk to the WebSockets server and send messages, but whenever an error is raised within the EventMachine loop it doesn't crash the script - which is what...