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

WebRTC seed doesn't happen until client connects from same network #854

Open
hayzamjs opened this issue Jul 27, 2023 · 6 comments
Open

WebRTC seed doesn't happen until client connects from same network #854

hayzamjs opened this issue Jul 27, 2023 · 6 comments

Comments

@hayzamjs
Copy link

hayzamjs commented Jul 27, 2023

I'm using cmd/torrent by building it like this:

go build -o /tmp/torrent_cmd ./cmd/torrent

And then seeding a file like this:

/tmp/torrent_cmd serve /tmp/sintel.mp4

It starts up with a few messages :

(base) ┌─[me@pc]─[~/Projects/test]
└──╼ $/tmp/torrent_cmd serve /tmp/modded-sintel.mp4
"modded-sintel.mp4": magnet:?xt=urn:btih:237a8fecf92ce838b6706a0012e44f84a31b7232&dn=sintel.mp4&tr=wss%3A%2F%2F<my-tracker>
[2023-07-27 05:26:41 +0530  WRN] tracker client for "wss://<my-tracker>": unhandled announce response "{\"action\":\"announce\",\"complete\":1,\"incomplete\":0,\"info_hash\":\"#z\u008fìù,è8¶pj\\u0000\\u0012äO\u0084£\\u001br2\",\"interval\":120}" [github.com/anacrolix/torrent/webtorrent tracker-client.go:336]
[2023-07-27 05:27:13 +0530  WRN] tracker client for "wss://<my-tracker>": webrtc PeerConnection state changed to closed [github.com/anacrolix/torrent/webtorrent transport.go:73]

And continues to have messages like this:

[2023-07-27 05:27:13 +0530  WRN] tracker client for "wss://<my-tracker>": webrtc PeerConnection state changed to closed [github.com/anacrolix/torrent/webtorrent transport.go:73]
2023/07/27 05:27:28 context deadline exceeded
[2023-07-27 05:27:35 +0530  WRN] tracker client for "wss://<my-tracker>": webrtc PeerConnection state changed to closed [github.com/anacrolix/torrent/webtorrent transport.go:73]
2023/07/27 05:27:38 max retry time elapsed: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:4317: connect: connection refused"
[2023-07-27 05:27:47 +0530  WRN] tracker client for "wss://<my-tracker>": webrtc PeerConnection state changed to closed [github.com/anacrolix/torrent/webtorrent transport.go:73]
2023/07/27 05:27:48 max retry time elapsed: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:4317: connect: connection refused"
[2023-07-27 05:29:10 +0530  WRN] tracker client for "wss://<my-tracker>": webrtc PeerConnection state changed to closed [github.com/anacrolix/torrent/webtorrent transport.go:73]
2023/07/27 05:29:13 max retry time elapsed: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:4317: connect: connection refused"

And I'm unable to stream the video file from a remote PC using instant.io or any other webtorrent client. But the catch is.. the moment I start playing the same video (with the same magnet) on my PC (the same PC as the one that is seeding the torrent) everything is fine and all the peers get the video stream..

I have tried both the reference bittorrent-tracker as well as the openwebtorrent tracker, both of them show the same issue

EDIT: I also just tested webtorrent's desktop client and there too there's the same issue (with the same tracker), public trackers also have the same issue so I don't think it's that, is this something that is isolated to my PC/network or is it a known thing with the protocol, some pointers in the right direction would be super helpful!

@anacrolix
Copy link
Owner

I'm not very strong with WebRTC concepts, but it sounds very much like there's an issue with seeding over WebRTC from your network. If you are unable to seed with other WebRTC BitTorrent clients too, this seems like the logical answer.

@hayzamjs
Copy link
Author

Thank you for the quick response. I tried seeding from a VPS with firewall turned off and a static IPv4/IPv6 directly attached to and I have pretty much the same results, didn't test with webtorrent desktop yet (probably have to try with webtorrent-hybrid)

Also are those connection closed messages normal?

@anacrolix
Copy link
Owner

I'll check when I get time. They should be normal, the logging levels might just be off.

@amaghzaz-y
Copy link

@hayzamjs I think you need to use WebTorrent-hybrid to make a bridge between webrtc peers and bittorrent peers, and also use the webtorrent tracker. they have a simple tool on their website called Webtorrent desktop, you can use that as a bridge to test the connectivity since it supports both protocols.

@anacrolix
Copy link
Owner

Thanks for the insight @amaghzaz-y. I believe anacrolix/torrent classifies as a hybrid client, but I don't know if that helps here.

@anacrolix
Copy link
Owner

I'm not going to have time for this. If anyone wants to take it. go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants