java - How can I code a web app p2p network? -
i wanted code web application, 1 user can choose file , other multiple users can download specified file off of that user's computer. that user have leave computer on , leave web page open.
i dont want have big main server has handle traffic. that user's computer server, persay. understand i'll use torrent.
all has done on website.
will web socket work?
please , thanks.
this isn't possible variety of reasons:
- firewalls / nats
- dynamic ips
- no "server" running on user's machines
- permissions on user's machine
- what happens if user deletes file on machine?
to make work you'd have to:
- convince user install app on machine (you'd need windows/linux/... exe)
- get user open port in firewall (or use library enable nat passthru)
- have user's pc ping server in event user's ip changes
on server side, you'd have keep several database tables, here few can think of off top of head:
- a user's table (user id [pk], current ip, communications port, (maybe other tracking things))
- available downloads table (download id [pk], user id [fk])
then when wants go off , download, have (probably) launch app requisite arguments (remote user's ip/port/file id) , have work of download.
this no means easy feat.
Comments
Post a Comment