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

Set proxy programmatically #2

Open
kdzwinel opened this issue Nov 20, 2015 · 7 comments
Open

Set proxy programmatically #2

kdzwinel opened this issue Nov 20, 2015 · 7 comments

Comments

@kdzwinel
Copy link
Owner

Right now proxy has to be set by hand, there should be a way to set it programmatically.

Question: Should that be a default behaviour? If I want to debug network traffic for a specific thing (e.g. npm), not the whole system, it's better for me to have control.

Challenge: even if it's possible how do we support all operating systems?

@samccone
Copy link
Collaborator

cc @fcanas for mac... do you know if this is scriptable via jscore?

@max-mapper
Copy link

I have another idea that might work (for OSX/Linux). Recently @mafintosh and I wrote https://www.npmjs.com/package/utun which lets you create virtual network devices by using the same syscall that VPN software uses to redirect all system traffic over a custom tunnel. Combining the utun module with some IP routing tricks (using the route command) can redirect system traffic to your own process.

@kdzwinel
Copy link
Owner Author

@maxogden that sounds neat! Although, I'm not quite sure what are the benefits of using utun over a proxy - easier setup? (doesn't it require root access?) more accurate data? better transparency?

@max-mapper
Copy link

The benefit is that you can do it programmatically and capture all system traffic

@fcanas
Copy link

fcanas commented Nov 25, 2015

@samccone JSCore still needs to be kicked off from a native process which I don't think there's any well-understood tooling for. I think a node native module is the right approach. If you don't want to use utun, it shouldn't be too hard to write your own:

Documentation for configuring network services on the Mac -- see about proxies dictionary in "The System Configuration Schema"
Boilerplate for a node native module

@samccone
Copy link
Collaborator

awww snap thanks for the info @fcanas :)

@max-mapper
Copy link

We're happy to add anyone to utun who wants to help improve it too (http://openopensource.org/ style). Only thing it needs right now is prebuilt binaries (we use https://www.npmjs.com/package/prebuild but havent hooked it up there yet because we haven't needed to use utun in production yet)

@kdzwinel kdzwinel changed the title Set proxy programatically Set proxy programmatically Apr 1, 2016
@kdzwinel kdzwinel self-assigned this Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants