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

Streaming - Status Code:101 Switching Protocols #396

Closed
MrTibbles opened this issue Aug 5, 2015 · 12 comments
Closed

Streaming - Status Code:101 Switching Protocols #396

MrTibbles opened this issue Aug 5, 2015 · 12 comments

Comments

@MrTibbles
Copy link

@MrTibbles MrTibbles commented Aug 5, 2015

Firstly, love th project!

Basically I am trying to simply stream a torrent into an audio player, however i am getting:
Status Code:101 Switching Protocols
Any ideas as to why this would be occuring?

Thank you in advance :)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 5, 2015

This is expected. It's what Chrome shows when a WebSocket connection is active. WebSockets are used to communicate with a tracker server for finding peers.

If you switch to the "Frames" tab (to the left of "Headers") you should see that data is sent to/from the tracker.

@feross feross closed this Aug 5, 2015
@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

Ok thanks for the speedy response! I can confirm there are readings in the frames panel, however the function is not being triggered. I waited for at least 10 mins and still nothing, which is why i thought it to be an issue. Please advise

Thank you once again :)

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

{
"complete": 0,
"incomplete": 1,
"action": 1,
"interval": 600000,
"info_hash": "\u0013è4ü-ÊÛ\u000eP/B¶\u0012½¨ÆÆá¶"
}

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 6, 2015

You can't just paste in any random magnet uri or .torrent file. Is the torrent being seeded by a webrtc-capable client, i.e. webtorrent-hybrid or instant.io?

In the browser, WebTorrent can only download torrents that are explicitly seeded to web peers via a WebTorrent capable client. Desktop torrent clients need to support WebRTC to peer with web browsers.

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

I was simply trying to test with a, yes random, torrent. I didnt realise that was th case. :/

Where would i get hold of an example torrent that works?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 6, 2015

You can seed any file by drag-and-dropping it onto https://instant.io

On Thu, Aug 6, 2015 at 3:46 PM MrTibbles notifications@github.com wrote:

I was simply trying to test with a, yes random, torrent. I didnt realise
that was th case. :/

Where would i get hold of an example torrent that works?


Reply to this email directly or view it on GitHub
#396 (comment).

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

ok cool, currently at my full time job, so can’t attempt to do so just yet. But thank you once again for the incredible service :)

On 6 Aug 2015, at 14:47, Feross Aboukhadijeh notifications@github.com wrote:

You can seed any file by drag-and-dropping it onto https://instant.io

On Thu, Aug 6, 2015 at 3:46 PM MrTibbles notifications@github.com wrote:

I was simply trying to test with a, yes random, torrent. I didnt realise
that was th case. :/

Where would i get hold of an example torrent that works?


Reply to this email directly or view it on GitHub
#396 (comment).


Reply to this email directly or view it on GitHub #396 (comment).

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

ok cool, im now successfully getting the torrent, however now webtorrent is throwing an error when trying to pipe the file into the audio tag. Is this also expected?

Uncaught TypeError: e.on is not a function56.c.pipe @ webtorrent.min.js:2(anonymous function) @ web-torrent-view.js:25o @ webtorrent.min.js:13(anonymous function) @ webtorrent.min.js:13187.i.emit @ webtorrent.min.js:8(anonymous function) @ webtorrent.min.js:5195.u.run @ webtorrent.min.js:8l @ webtorrent.min.js:8

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 6, 2015

What code are you using?

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

I am using the example for streaming audio to player

https://github.com/feross/webtorrent/blob/master/examples/browser-stream-to-audio.js https://github.com/feross/webtorrent/blob/master/examples/browser-stream-to-audio.js

On 6 Aug 2015, at 20:00, Feross Aboukhadijeh notifications@github.com wrote:

What code are you using?


Reply to this email directly or view it on GitHub #396 (comment).

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 6, 2015

@MrTibbles

This comment has been minimized.

Copy link
Author

@MrTibbles MrTibbles commented Aug 6, 2015

Thanks, thats working now. Thank you once again Feross, your a dude :)

On 6 Aug 2015, at 21:40, Feross Aboukhadijeh notifications@github.com wrote:

Ah, this example is out of date. I just updated it:

https://github.com/feross/webtorrent/blob/master/examples/browser-stream-to-video-or-audio.js https://github.com/feross/webtorrent/blob/master/examples/browser-stream-to-video-or-audio.js

Reply to this email directly or view it on GitHub #396 (comment).

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 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
2 participants
You can’t perform that action at this time.