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

Only works with websocket trackers #52

Closed
gmbuell opened this issue May 29, 2015 · 7 comments
Closed

Only works with websocket trackers #52

gmbuell opened this issue May 29, 2015 · 7 comments

Comments

@gmbuell
Copy link

gmbuell commented May 29, 2015

Setting TRACKER_URL to an http or udp tracker does not work (and does not produce any errors).

@feross
Copy link
Member

feross commented May 29, 2015

Yeah, this is a limitation of the browser. The browser can't make TCP or UDP connections for security reasons. No browsers can do this.

@gmbuell
Copy link
Author

gmbuell commented May 29, 2015

UDP totally makes sense but why can't the browser query the http interface?

@feross
Copy link
Member

feross commented May 29, 2015

Assuming the http tracker set the correct cross-origin headers (unlikely), what would the browser do with the resulting ip:port addresses that the tracker returns? It can't make TCP connections, so it's not very useful.

The browser can only make webrtc connections.

@gmbuell
Copy link
Author

gmbuell commented May 29, 2015

Oh I certainly agree the connections to peers would have to be websocket. I'm unfamiliar with the details of WebTorrent. Are the peers returned by the websocket tracker in a different format than the http version to distinguish them as websocket? The idea here is that websocket clients could still use something like opentracker rather than being restricted to bittorrent-tracker (not that there's anything wrong with it, just for ease of setup).


Sent from Mailbox

On Fri, May 29, 2015 at 12:45 PM, Feross Aboukhadijeh
notifications@github.com wrote:

Assuming the http tracker set the correct cross-origin headers (unlikely), what would the browser do with the resulting ip:port addresses that the tracker returns? It can't make TCP connections, so it's not very useful.

The browser can only make webrtc connections.

Reply to this email directly or view it on GitHub:
https://github.com/feross/instant.io/issues/52#issuecomment-106913424

@feross
Copy link
Member

feross commented May 29, 2015

Sorry that this isn't clearer from the documentation. I'm working on improving docs. Right now, webtorrent in the browser MUST use a websocket tracker. The only implementation of a websocket tracker is currently the bittorrent-tracker package. Maybe opentracker could support websockets in the future? But until then, you have to use bittorrent-tracker.

The peers returned from the websocket tracker are fundamentally different than those for normal bittorrent. Normal bittorrent returns "ip:port" addresses. The websocket tracker returns webrtc offer/answers. It's a bit more complicated :)

@gmbuell
Copy link
Author

gmbuell commented May 29, 2015

Ahh I see thanks for clearing that up. Is there a more formal spec for the websocket tracker RPC? Or is it just the code right now?


Sent from Mailbox

On Fri, May 29, 2015 at 1:11 PM, Feross Aboukhadijeh
notifications@github.com wrote:

Sorry that this isn't clearer from the documentation. I'm working on improving docs. Right now, webtorrent in the browser MUST use a websocket tracker. The only implementation of a websocket tracker is currently the bittorrent-tracker package. Maybe opentracker could support websockets in the future? But until then, you have to use bittorrent-tracker.

The peers returned from the websocket tracker are fundamentally different than those for normal bittorrent. Normal bittorrent returns "ip:port" addresses. The websocket tracker returns webrtc offer/answers. It's a bit more complicated :)

Reply to this email directly or view it on GitHub:
https://github.com/feross/instant.io/issues/52#issuecomment-106923091

@feross
Copy link
Member

feross commented May 29, 2015

Right now it's just the code, but it's quite simple. It's very similar to the current tracker spec, but with a few changes to accommodate webrtc. I'll write up a formal spec asap.

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

2 participants