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

Allow configuring proxy for James to use #413

Open
mhtvsSFrpHdE opened this issue Feb 11, 2019 · 7 comments
Open

Allow configuring proxy for James to use #413

mhtvsSFrpHdE opened this issue Feb 11, 2019 · 7 comments
Labels

Comments

@mhtvsSFrpHdE
Copy link

mhtvsSFrpHdE commented Feb 11, 2019

While connected to a VPN,
James use VPN to connect.
In this case if James required to connect directly that not use VPN,
have to disconnect VPN first.

Any plan to given a option that not use direct connect,
that to use another proxy as parent proxy?

@mitchhentges
Copy link
Member

Hey! 👋
Got two questions:

  • What are you using to VPN? Is it OpenVPN?
  • If you connect to your VPN, and you run Firefox or Chrome (without proxying through James), does it go through the VPN or go through the proxy?

Note: does James use the Windows system proxy in "Internet options"? FWIW, I frequently set that system proxy to point to James (localhost:1338), and James ignores it - my traffic doesn't loop in on itself. Instead, browser traffic gets sent to James, and James goes straight to the destination

@asharron
Copy link

Hey! I would like to have something like this too.

If you look at Charles, they have an option called external URL proxy settings where instead of Charles going straight to the destination, it routes it through whatever proxy url you give it. I'd like to have similar functionality for James since I am behind a corporate proxy that also requires authentication.

I wouldn't mind adding this functionality myself if you could give me a few pointers on how to get started. I'm pretty familiar with React + Redux, but not electron and how the project itself is setup.

@mitchhentges mitchhentges changed the title Custom parent proxy instead following system proxy? Allow configuring proxy for James to use Feb 15, 2019
@mitchhentges
Copy link
Member

That would be awesome asharron!
We have some docs for contributing, which should get you set up with a local build.

This feature might be a little tough to do, since you need to do:

  • Add a way in the UI to configure proxy
  • Get these configuration values from the UI process to the main process
  • Provide these values to hoxy, the proxy library we're using under-the-hood.

I'd recommend looking at the logic for throttling network speed to see how we've configured hoxy in other ways.

A PR would be fantastic and appreciated! Feel free to set up a fancy new draft PR and asking any questions you might run into :)

@asharron
Copy link

So as an update, I figured out to use an external proxy with Hoxy. You can use an option called upstreamProxy when creating the server. To test this out, I added it to the opts object you create in proxy,.js and it worked fine.

The problem for me, however, is that I need to use authentication in order to use the external proxy. So instead of using the typical host:port format, I need to use origin%5CUsername:Password@host:port which it looks like Hoxy doesn't support at the moment, at least judging by the options given in the docs.

I'm going to see if I can find a way to enable this. I may have to submit a PR there first before this feature gets incorporated in James.

I'll keep you updated if I find anything.

@mhtvsSFrpHdE
Copy link
Author

It was my mistake.
I did a test again and confirmed that James does connect directly instead of following system proxy.
This lead to another issue that,
if I want the James to connect directly and not to use VPN,
I have to disconnect the VPN first.

Just like the other mention,
a custom parent proxy would match the two case at the same time,
so can avoid repeat about connect and disconnect the VPN many times.

Although write scripts to manage VPN connection faster is not a bad idea.😅

@asharron
Copy link

asharron commented Apr 1, 2019

Hey, I ran into some issues when implementing this feature, and I am actually leaving the role that I was going to add this feature for.

Because of this, I don't think I will be finishing the feature.

For someone who is looking to implement this, basically you would need to make a pull request to hoxy that allows you to add proxy credentials when you specify and upstream proxy.

This was a bit tricky for me since it involved understanding how proxy requests work with http headers (and also because the hoxy code base is a bit difficult to understand).

Once hoxy has that feature in it, then James would have the feature as well. A menu could then be added to toggle the credentials for the upstream proxy (could even maybe just have a config file for starters until getting around to creating a React component for it).

Hope this helps someone and sorry for not figuring it out!

@mitchhentges
Copy link
Member

Thanks for taking a look Alex!
This directions-for-next-dev comment is super awesome as well 💯 you're a champ.

Good luck in your new role!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants