Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Sending Raw Binary Data Between Two Servers With Websockets/Node.js?

Sending Raw Binary Data Between Two Servers With Websockets/Node.js?

Problem

I've been reading lately about Node.js, Websockets and Socket.io out of curiosity. However, the other day I was thinking of a problem one of my client faces and was wondering if they may be the solution. Essentially, there are two servers. Server 1, is serving raw binary data. Server 2, is setup to receive and handle that binary data.

What needs to happen is data from server 1, is passed through a web browser and then delivered to server 2.

I'm curious to know if this is possible, and what angles you may take to solve it?

Problem courtesy of: Patrick Hankinson

Solution

It's certainly possible. The connections to both will need to be initiated from the browser/Javascript, but once in place it should be easy to proxy the data from one to the other.

However, there are many non-browser WebSocket clients so you might consider just making a direct WebSocket connection from one server to the other. See this wikipedia page for WebSocket client (and server) implementations.

Solution courtesy of: kanaka

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Sending Raw Binary Data Between Two Servers With Websockets/Node.js?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×