P2P photo sharing app - websocket

I want to implement a P2P photo sharing application.Scenario is like this:
A is online and he would like to share his photos with B. Through some server, B gets A's IP address and access A's photos directly.
Is it possible to implement using WebRTC or Websocket ? Please give me some inputs,
Thanks

I implemented P2P file transfer on websockets with very small nodejs server. But it works fine only on Chrome thanks to "download" tag. I also have to have middleware server so it's not STRICTLY P2P. My node.js server never has full file it just transfer current file chunk from one websocket connection to another.
I hope WebRTC will help you to implement what you wish more smouthly, without any middleware.

Related

Anybody implemented IceLink in Xamarin?

I am going to develop an application which includes Audio/Video/Text chat.
I read IceLink documentation and demo. From that what I understood is we need to do signalling using WebSync to connect two peers.
But I couldn’t understand how to do it.
My questions are (suppose A wants to call B):
1. How A knows the address of B (whatever it may be like, ID or anything)
2. How B comes to know that A is calling him/her
We once build an App with P2P Connection via IceLink.
But we didn´t use the WebSync Component.
To establish a RTC Connection you need a non-P2P communcation to do the Handshake first.
With this Handshake all neccessary information is transmitted, and icelink can try to reach the other peer.
We used Microsoft SignalR for that since it is a serverside-javascript which can push messages to connected clients.
1.this is part of the handshake
2.Signaling via SignalR (e.g.)
I followed their example and achieved the same thing as you are intending to.
You need to handle call making on the server-side and somehow communicate the session id to another user . as simple as that.

Send private message between two peers with socket.io

I'm trying to understand the concepts of socket.io and websockets.
Suppose you have many users connected in a channel over socket.io, can two (peers) of them start a private conversation (with video for example) without passing their data through socket.io server?
For instanace, browser to browser with websocket.
I am asking because I need to let the data (audio video) flow from browser to browser between two users so the server will not be saturated with data of users starting private conversation.
If it is possible, what data needs to be exchanged to make this happen?
You should read this answer, how to make a browser to browser connection.
https://stackoverflow.com/a/7933140/3375010
Actually, it's not possible to initiate a p2p communication with socket.io. But WebRTC allows that, it supports browser to browser applications for voice, video, file sharing...

What's the best way to be able to continously be able to receive WebRTC calls in browser?

Need to be able to continuously receive calls when a Chrome webpage is open. How do I do that even for users who are inside a strict enterprise network?
WebSockets? (but there's the proxy problems that doesn't know what wss:// is)
HTTP? (but will I have to poll?)
Other?
Since you included the "vLine" tag, I'll reply with some information on how our WebRTC platform will behave in an enterprise network. vline.js will use a secure WebSocket by default if the browser supports it and fall back to HTTPS long polling. As described here, the secure WebSocket may work depending on the exact proxy configuration. Feel free to test it out by using GitTogether or creating your own vLine service for testing.

Instant Transfer file between 2 browser clients via TCP

Is it possible to create a website that makes possible this scenario:
User A logs into the website, uploads a file making a direct TCP connection to user B that it is within the same site at same time downloading the file. Without passing the file trough the server.
How to make user B to listen through a browser?
Would this violate "Same origin policy"?
Point is to use browser and no other software like P2P clients.
Is this crazy idea possible?
I doubt webRTC covers exactly what you need.
You have two issues:
B, if running from a web browser, cannot open a port to receive an inbound connection
Even if B were able to do that, you will likely have to face NAT traversal issues.
The solution is to use/implement a relay server:
A opens an outbound HTTP/Websocket connection to the relay server
B opens an outbound HTTP/Websocket connection to the relay server
A sends data to the relay server on the outbound channel (HTTP POST for instance)
B reads data from the relay server on the response (to an HTTP GET for instance)
Easier said than done.... (and yes it is a feature of advanced P2P networks like JXTA, XMPP, Skype..., and yes you unfortunately need an intermediate server)
Check ICE for a specification of 'how to do NAT traversal'
Sure, it's called P2P. You don't even need Ajax.
What I was looking is: WebRTC.
Others have mentioned WebRTC, but here is a live example:
http://sharefest.me

Peer-to-peer file sharing with Web Sockets

This is sort of a theoretical question, however, I need to add file sharing capabilities to my web socket powered chat application. I could use a service like Amazon S3 to upload a file to share by posting a link to the file, but that involves the uploading of a file that may already be accessible over the local network (sharing a file between co-workers for example).
So I had the idea that it might be possible to somehow tunnel the upload/download/transfer through the already existing web socket connection. However, I don't know enough about HTTP file transfer to know the next step of how to implement it. Is there a limitation to web sockets that would prevent this from being possible?
I'm using Ruby and EventMachine for my current web socket implementation. If you were able to provide a high level overview to get me started, that would be very much appreciated.
Here's an example of a project that uses only Web Sockets and the javascript File API for transferring files: http://www.github.com/thirtysixthspan/waterunderice
To allow files to be shared without the need to upload it to the server, (i.e Coworkers) you can now use the WebRTC DataChannel API, to create a peer to peer connection.

Resources