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

Support Electron (atom-shell) or NW.js (node-webkit) #304

Closed
arestov opened this issue Apr 30, 2015 · 11 comments
Closed

Support Electron (atom-shell) or NW.js (node-webkit) #304

arestov opened this issue Apr 30, 2015 · 11 comments

Comments

@arestov
Copy link

arestov commented Apr 30, 2015

Is it possible that webtorrent works bad in nw.io because of nw.io provide both node.js and browser enviroment in same time?
For e.g.

if (typeof window === 'object' && window.document) {
   // stuff for browser
} else if (typeof global === 'object' ) {
  // stuff for node.js
}

but in this case is better to use node.js since it has more privileges.
May some wrong detection of using dgram or ArrayBuffer.
Or code select buffer from browser (since it more natvie, or maybe more perfomant) but select node dgram and them are not compatible, etc

@MickdeGraaf
Copy link

Hi I'm facing the same issues where WebTorrent doesn't play nice with node-webkit.

I believe you can load webtorrent in a child process so it won't conflict with node-webkit.
The WebTorrent app does it this way https://github.com/feross/webtorrent.app.

An example on how to get this working would be a great help to me.

@feross
Copy link
Member

feross commented May 2, 2015

What issues are you seeing in NW.js?

Hm, I'm going to work on getting WebTorrent working in Electron (atom-shell) right now and fix problems as they come up. Electron is sufficiently similar to NW.js that this might fix your issue.

If there are other lingering NW.js issues, PR welcome!

@arestov
Copy link
Author

arestov commented May 2, 2015

I don't see any specific issues. Just guessing.

Electron look like have different from nw.js arcitecture.

Electron has 1 process for node and 1 process for chromium, each with different enviroments.

nw.js has enviroments of node.js and chromium in 1 process (you have global.process and window.document in same thread) wich I expect can be cause of some problems.

(so because of this and the reason you will fix problems of Electron I will switch to it too)

@feross feross changed the title nw.io: node.js vs browser Support Electron (atom-shell) or NW.js (node-webkit) May 3, 2015
@MickdeGraaf
Copy link

It looks like my issues are not related to electron or nw.js.

I also tested WebTorrent in the terminal and it's not working on my system. It's very slow and the download is really unstable. Most of the time the download speed is 0B/s.

I tried reinstalling node and WebTorrent but that didn't help. I'm using a macbook with Yosemite 10.10.3
Are there any known issues or do you have any tips to get WebTorrent running?

Your help is very much appreciated.

@jakefb
Copy link
Contributor

jakefb commented May 5, 2015

WebTorrent is working well for me in electron. There is one issue I'm having with the videostream module though jhiesey/videostream#3

@gyzerok
Copy link

gyzerok commented Jun 5, 2015

@feross Same problem here. Cant get webtorrent working with nw.js. Suppose that webtorrent thinks its in browser context and uses only webtrc. Any workaround for this?
Maybe there is a way to force webtorrent use node environment?

@feross
Copy link
Member

feross commented Jun 6, 2015

@gyzerok This is not intended behavior. WebTorrent should use whatever capabilities are available. In nw.js, it should connect to tcp and webrtc peers.

This isn't high priority for me at the moment. If you send a PR to fix the bug, I'll happily merge it though :)

@mcanthony
Copy link

It seems to me that NW.JS and it's unified sexification model of Node and Webkit would in fact be quite ideal for this use case. When combining this and other tech using Electron it would seem one must create an IPC bridge between them, whereas the shared context of NW.JS would allow them to work together naturally (correct me if I am wrong as this area is of much interest to me) - as well as more efficiently (right?).

Would outfitting Webtorrent with proper context detection/handling when used in either unified(nw), separate(electron), or browser(client) contexts solve these issue of compatibility? or is there more to this issue than I currently understand...

@feross you mentioned fixing this to work with Electron, what is the status on this and if you don't mind my asking, what was/is necessary to happen in order to make this fix? I would be happy to provide a fix via PR as soon as I fully grok the problem.

@rom1504
Copy link
Member

rom1504 commented Mar 19, 2016

Electron seems to be fully supported, now that there is https://github.com/feross/webtorrent-app

@feross
Copy link
Member

feross commented Mar 24, 2016

@rom1504 You're right. I consider this fixed now that we're actually using this in Electron :)

In case folks missed the news, see WebTorrent.app: https://github.com/feross/webtorrent-app

Grab a download here: https://github.com/feross/webtorrent-app/releases (We're only doing OS X builds for now, but Windows/Linux are coming very soon)

@feross feross closed this as completed Mar 24, 2016
@lock
Copy link

lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants