nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.39k stars 3.88k forks source link

VPN connection #4331

Closed TransferFantasy closed 8 years ago

TransferFantasy commented 8 years ago

Is there any way of getting VPN connection inside NW app? I want only requests from NW app to go through VPN, not system-wide.

losywee commented 8 years ago

Yes, you can, but you need export an API for NW.

ColonelBundy commented 8 years ago

Popcorntime used a vpn client inside their app, take a look at their source and see how they did it.

TransferFantasy commented 8 years ago

I looked inside popcorn.io, but everything vpn.js does is var vpnClient = gui.Window.open('https://client.vpn.ht/', { position: 'center', title: 'VPN.HT', icon: 'src/app/images/icon.png', focus: true, toolbar: false, resizable: false, show_in_taskbar: false, width: 500, height: 500 }); This url gives 403 (

TransferFantasy commented 8 years ago

losywee commented 6 hours ago Yes, you can, but you need export an API for NW.

How can I do this?

shaynem commented 8 years ago

OpenVPN has a socket interface so you can just nodejs to control the management port

This should set you on the right track

alternatively you can just use the command line to start OpenVPN process with a config file from nodejs also.

you can then make it just route a specific IP for example or use a proxy server in nwjs and route that proxy only via OpenVPN that way all traffic from the app goes via the VPN encrypted On 29 Jan 2016 8:11 pm, "TransferFantasy" notifications@github.com wrote:

losywee commented 6 hours ago Yes, you can, but you need export an API for NW. How can I do this?

— Reply to this email directly or view it on GitHub https://github.com/nwjs/nw.js/issues/4331#issuecomment-176916891.

ColonelBundy commented 8 years ago

@TransferFantasy That's weird... Looks like they removed the feature... Before you could enter in vpn details and hit connect basically. That's what I remember at least.

rogerwang commented 8 years ago

please submit questions to mailing list.