Skip to content

Tag: websocket

File API – Blob to JSON

I’m trying to do some experiment with HTML5, WebSocket and File API. I’m using the Tomcat7 WebSocket implementation. I’m able to send and received text messages from the servlet. What I want to do now is to send from the servlet to the client JSON objects, but I want to avoid text message in…

Sending websocket ping/pong frame from browser

I keep reading about ping/pong messages in websockets to keep the connection alive, but I’m not sure what they are. Is it a distinct frame type? (I don’t see any methods on a javascript WebSocket object in chrome related to ping-pong). Or is it just a design pattern (e.g. I literally send “p…

Multiple websocket connections

Is there any advantages of having two distinct websocket connections to the same server from the same client? To me this seems a bad design choice, but is there any reason why/where it should work out better? Answer There are several reasons why you might want to do that but they probably aren’t too com…

Cross-domain connection in Socket.IO

Is it possible to use Socket.IO in a cross domain manner? If so, how? The possibility is mentioned around the web but no code examples are given anywhere. Answer Quoting the socket.io FAQ: Does Socket.IO support cross-domain connections? Absolutely, on every browser! As to how it does it: Native WebSockets ar…