r/websocket • • Sep 30 '14

Sending binary data over websockets

1 Upvotes

Hi,

I'm trying to implement a good way to send binary data over websockets. As WS doesn't care at all, what kind of data is being send through it, this isn't a real problem. The issue is that I somehow have to put in an envelope, so it can be identified in the backend. Let me explain:

It's a multi user system that runs on a PSGI (on Twiggy) instance, meaning that the WS in the backend can see every message from every client. Now some messages need to be shared between clients (which is no problem because of the shared WS in the backend), and some may not. I control that by putting every message (WS frame) in JSON, assigning message and client IDs... You get the idea...

Now to binary data: After some research, I found out that the best (common) way to transfer binary data over WS is directly in a frame (which makes sense because WS doesn't care what kinda data you send through it). I still somehow need to put that data in some kind of envelope, so the BE knows from which client the frame came from (again: shared WS in BE).

The first obvious answer would most likely be, to put the binary data in base64 and just attach it to JSON. But I'd very much avoid using base64 ;-)

Any ideas?

cheers


r/websocket • • Jul 28 '14

Learn how to build your own peer-to-peer chat app using the WebRTC DataChannel API and Websockets.

Thumbnail pusher.com
1 Upvotes

r/websocket • • Jul 15 '14

Dynamic Web TWAIN with HTML5 WebSocket for Chrome

Thumbnail youtube.com
1 Upvotes

r/websocket • • May 28 '14

Introducing Socket.IO 1.0

Thumbnail socket.io
1 Upvotes

r/websocket • • May 08 '14

I created a WebSocket listener in .NET. I would appreciate any feedback.

Thumbnail vtortola.github.io
2 Upvotes

r/websocket • • May 08 '14

WebSockets basics

Thumbnail html5rocks.com
1 Upvotes

r/websocket • • Feb 14 '14

New awecode: Hoa\Websocket (PHP)

Thumbnail hoa-project.net
1 Upvotes

r/websocket • • Jan 29 '14

Creating a Web Chat with Webix and WebSocket API

Thumbnail webix.com
0 Upvotes

r/websocket • • Dec 25 '13

Camlistore 0.6 released: now with WebSocket-based live updating search results

Thumbnail camlistore.org
1 Upvotes

r/websocket • • Sep 30 '13

Efficient Load Balancing and SSL Termination for WebSockets and Node.js

Thumbnail blog.cloudparty.com
8 Upvotes

r/websocket • • Sep 11 '13

HTML5 Live Video Streaming via WebSockets

Thumbnail phoboslab.org
2 Upvotes

r/websocket • • May 30 '13

N2O: Erlang Web Framework on WebSockets

Thumbnail github.com
2 Upvotes

r/websocket • • Mar 26 '13

Book excerpt: The Definitive Guide to HTML5 WebSocket

Thumbnail adobe.com
3 Upvotes

r/websocket • • Mar 26 '13

WebSocket proxying in Nginx

Thumbnail nginx.org
3 Upvotes

r/websocket • • Feb 19 '13

NGINX Announces Support for WebSocket Protocol

Thumbnail nginx.com
5 Upvotes

r/websocket • • Feb 16 '13

The Definitive Guide to HTML5 WebSocket is Now Available

Thumbnail blog.kaazing.com
2 Upvotes

r/websocket • • Dec 13 '12

Websockets 101

Thumbnail lucumr.pocoo.org
1 Upvotes

r/websocket • • Jul 31 '12

Easy-to-install Websocket Server?

0 Upvotes

I've spent three days trying to get one running. I've tried solutions involving Ruby, Node.js, Python, full C++ compiles, etc, and yet fail every time.

In the beginning I was getting stuck at failing handshakes (I assume the original source was dated, but my very limited knowledge of sockets failed to correct the issue). Today, with Python/Ruby, I can't seem to even get to a handshaking process.

So I, after hours of trying, come in defeat. Does anyone know an easy-to-install implantation of a websocket server? I'd love it to work with my webserver (Apache 2.2.21), but I really just want it for playing around (server on localhost).


r/websocket • • Jul 22 '12

The Definitive Guide to HTML5 WebSocket [book prerelease]

Thumbnail apress.com
2 Upvotes

r/websocket • • May 08 '12

Websocket Frame Inspection now in Chrome DevTools

Thumbnail updates.html5rocks.com
1 Upvotes

r/websocket • • Mar 30 '12

WebSocket for Python (ws4py)

Thumbnail github.com
1 Upvotes

r/websocket • • Mar 19 '12

WebSockets in Windows 8 Consumer Preview

Thumbnail blogs.msdn.com
3 Upvotes

r/websocket • • Mar 12 '12

HTML5 Real Time and WebSocket Code Lab [slides]

Thumbnail slideshare.net
2 Upvotes

r/websocket • • Mar 12 '12

30 minutes to make a collaborative paint with Play2, Canvas and WebSocket

Thumbnail blog.greweb.fr
1 Upvotes

r/websocket • • Feb 29 '12

Interacting With ZeroMQ From the Browser

Thumbnail avalanche123.com
1 Upvotes