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

Using electron-wrtc in an Electron app #63

Open
romaincointepas opened this issue Aug 27, 2016 · 0 comments
Open

Using electron-wrtc in an Electron app #63

romaincointepas opened this issue Aug 27, 2016 · 0 comments

Comments

@romaincointepas
Copy link

To support SOCKS proxy for WebRTC in webtorrent in an Electron app, using a combination of electron-wrtc and window.webContents.session.setProxy({proxyRules:"socks5://1.2.3.4:1080"}) seems to be the simplest way to support this (even if not lightweight).

However, when testing (only on OS X for now), I've encountered some problems:

  • if node_modules/electron-prebuilt is in app.asar, then spawning the electron process will fail (I think it's a known bug with spawn and asar).
  • If node_modules/electron-prebuilt is in asar.unpacked (or the app is simply not packaged in an asar), codesign will fail: ...../app.asar.unpacked/node_modules/electron-prebuilt/dist/Electron.app/Contents/Frameworks/Electron Framework.framework: bundle format unrecognized, invalid, or unsuitable
  • If instantiating electron-wrtc with opts.electron = app.getPath('exe') (the path of the Electron executable from the current app), it throws an error (electron exited with code 0).

Here is the PR about SOCKS proxy support in webtorrent:
webtorrent/webtorrent#874

I'm also thinking that using electron-wrtc may be overkill in that case (as we could simply create a new hidden window, set a proxy on it and communicate back and forth for WebRTC).

Note: the reason why we can't just session.setProxy() in the current window is that it would then proxy everything happening there (we may not want to proxy connections to trackers for example, or we may be doing something else not webtorrent-related in that window, etc.).

Any suggestions on how to approach this?

Thanks!

cc @yciabaud

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

1 participant