Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTorrent in a LAN setting without Internet connection #636

Closed
Wasser-Eis opened this issue Feb 21, 2016 · 11 comments
Closed

WebTorrent in a LAN setting without Internet connection #636

Wasser-Eis opened this issue Feb 21, 2016 · 11 comments
Labels

Comments

@Wasser-Eis
Copy link

@Wasser-Eis Wasser-Eis commented Feb 21, 2016

Out of a software developer perspective:

How can I set up a WebTorrent network in a LAN without Internet connection?
It can be taken for granted that all members of the LAN can exchange signaling information.
Preferably the solution does not need a tracking/bootstrap server.

Probably a related question:
How can I connect a peer to a WebTorrent network without the help of a tracking/bootstrap server.
It can be taken for granted that the peer who wants to connect to the WebTorrent network can exchange information with a peer out of the WebTorrent network.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Feb 22, 2016

Right now there's no way for peers to connect without using a signaling server. Fortunately, you can run one of these easily on your own local network.

The package is called bittorrent-tracker. Just do:

$ bittorrent-tracker --port 8000
HTTP tracker: http://localhost:8000/announce
UDP tracker: udp://localhost:8000
WebSocket tracker: ws://localhost:8000

Ensure that the .torrent files and magnet links you generate include one of these (or all of these) tracker URLs. You can also force WebTorrent to use your local tracker server by including an announce option when you call client.add(). Like this:

client.add(torrentId, { announce: [ 'http://localhost:8000/announce', ... ] }

That should be it. Enjoy.

@feross feross closed this Feb 22, 2016
@feross feross added the question label Feb 22, 2016
@Wasser-Eis

This comment has been minimized.

Copy link
Author

@Wasser-Eis Wasser-Eis commented Apr 3, 2016

"Right now there's no way for peers to connect without using a signaling server. "
Go, go, go implement it. I would really appreciate this feature.
Would it help if I put a bounty on it? If yes, please open an issue for it.

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 3, 2016

have a look at #288 I guess

@Wasser-Eis

This comment has been minimized.

Copy link
Author

@Wasser-Eis Wasser-Eis commented Apr 4, 2016

I want to connect peers only by using torrent.addPeer(). The signaling data should be exchanged via QR-Codes. I want to put all peers into one single swarm.
Isn't that independent from the DHT feature?

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 4, 2016

Yes, I bet that's already possible. Did you try it ?

@Wasser-Eis

This comment has been minimized.

Copy link
Author

@Wasser-Eis Wasser-Eis commented Apr 4, 2016

"Yes, I bet that's already possible."
You are right.

I found the bug.
Now it works. :-)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 4, 2016

Nice!

@shinp

This comment has been minimized.

Copy link

@shinp shinp commented May 4, 2016

Do you have an offline implementation for wss://tracker.webtorrent.io? I am looking to create an 'offline' tracker (similar to that of bittorrent-tracker) that runs on wss:// protocol to support webrtc (related #325)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 4, 2016

@shinp I don't know what you mean by "offline implementation". The tracker needs to be reachable by the peers. You can, of course, run a tracker that's only accessible on your local network.

Peers can only connect to each other if they can both reach the same tracker.

@shinp

This comment has been minimized.

Copy link

@shinp shinp commented May 4, 2016

Sorry, I may have communicated this wrong. I am currently using your bittorrent-tracker implementation for local network peer discovery however browser webtorrent does not connect to webtorrent-hybrid and webtorrent-desktop implementations using a localhost bittorrent-tracker. I am assuming in this case the webtorrent-hybrid and webtorrent-desktop uses standard bittorrent peer connections to communicate rather webrtc.
Sorry, it looks like I did not investigate thorough enough - I'm investigating right now (as there might be a https <-> ws issue on the browser side)

EDIT: So there is nothing wrong with the bittorrent-tracker; I've made it connect to tracker wss://<local_address> and it works fine on the webtorrent-desktop <-> instant.io <-> simple html demo. Unfortunately, I discovered that webtorrent-hybrid does not work well on windows for webrtc given that I'm not using xvfb ~ is there any work around to this or special installation instructions?

@Zibri

This comment has been minimized.

Copy link

@Zibri Zibri commented Feb 7, 2018

isn't it possible to use DHT in a (big) LAN?

@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.