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

Adding an API to configure proxy [$85] #916

Closed
clowwindy opened this issue Jul 24, 2013 · 47 comments
Closed

Adding an API to configure proxy [$85] #916

clowwindy opened this issue Jul 24, 2013 · 47 comments

Comments

@clowwindy
Copy link

In 0.6.3 an API to get proxy for url has been added. Can we have an API to set proxy?

Chrome has a proxy API, which doesn't affect system settings. I'm wondering if nw could have the same feature.

http://developer.chrome.com/extensions/proxy.html

Did you help close this issue? Go claim the $85 bounty on Bountysource.

@xdqi
Copy link

xdqi commented Jul 27, 2013

Well, I wonder it could develop a method to support PAC file.

wikipedia:http://en.wikipedia.org/wiki/Proxy_auto-config

@wwqgtxx
Copy link

wwqgtxx commented Jul 27, 2013

like it too......

@erikjjohnson
Copy link

Right, can at least nw use the common HTTP_PROXY, http_proxy, HTTPS_PROXY, and https_proxy environment variables when it can't find any system settings?

The PAC and system support in this closed issue is wonderful:

#130

But I've found some linux variants that don't supply the system proxy settings in a way Chrome or nw can understand. In those cases, either using the environment variables or a command line option to set the proxy would be helpful. Of course, the proxy given should be returned by the new API in the above issue

@Pavel-Husakouski
Copy link

Actually, it is quite annoying to work behind proxy using NW-application, because users are asked for the credentials twice - first for NW, second for Node

@Pavel-Husakouski
Copy link

I think there should be implemented some common way - i.e. environment variable HTTP_PROXY which is accessible from the NW and Node, or, another option, some API

@liclac
Copy link

liclac commented Dec 26, 2013

Bump?

The project I'm working on at the moment needs me to find a portable web browser of some sort that runs things through a locally hosted proxy.
node-webkit would be perfect for the task if only I could figure out how to make it use said proxy…

@Pavel-Husakouski
Copy link

uppfinnarn: you can't unless the System config is set to your local hosted server. I implemented kind of http client to make nodewebkit working with my own proxy with authentication.

You can use chromium portable if you don't need any node.js modules. It has an extensions that allows you configure the proxy.

@liclac
Copy link

liclac commented Dec 26, 2013

Looking at that now, thanks. Not as elegant as I could make my node-webkit solution (where I could run the proxy within the same process), but it works.

@liclac
Copy link

liclac commented Dec 26, 2013

Nevermind, Windows only, back to looking for alternatives until (if) this gets addressed...

@felicienfrancois
Copy link

Need it too ...

@mkoryak
Copy link

mkoryak commented Jan 23, 2014

+1

@toddhay
Copy link

toddhay commented Jan 29, 2014

+1 as well

@felicienfrancois
Copy link

An API method would be cool but supporting the --proxy-server chromium arg is a first step and is probably easy to implement.

@epodolyak
Copy link

+1

@davidrapin
Copy link

I support felicienfrancois proposal to support the --proxy-server arg.
For users that cannot edit their system proxy configuration (at work for example), this is really necessary.

@iampuma
Copy link

iampuma commented Jun 5, 2014

+1 would be very useful

@wells1013
Copy link

+1 like it too......

@tholder
Copy link

tholder commented Aug 26, 2014

+1

@AlexVBr
Copy link

AlexVBr commented Aug 28, 2014

++

@devon
Copy link

devon commented Sep 16, 2014

+1

@rogerwang rogerwang changed the title Adding an API to configure proxy Adding an API to configure proxy [$35] Sep 16, 2014
@devon
Copy link

devon commented Sep 16, 2014

This feature is quite important for Chinese 👍

@rogerwang rogerwang added the dpd label Sep 16, 2014
@rogerwang rogerwang self-assigned this Sep 16, 2014
@cchersin
Copy link

+1

@devon
Copy link

devon commented Sep 24, 2014

proxy_service.cc:

#if defined(OS_WIN)
  return new ProxyConfigServiceWin();
#elif defined(OS_IOS)
  return new ProxyConfigServiceIOS();
#elif defined(OS_MACOSX)
  return new ProxyConfigServiceMac(io_thread_task_runner);

I think this is the code to check the system proxy. I will try to 'hard coding' the proxy setting before this issues be fixed.

@rogerwang rogerwang changed the title Adding an API to configure proxy [$35] Adding an API to configure proxy [$85] Oct 3, 2014
@Pavel-Husakouski
Copy link

Look, there are lots of cases - i.e. when app opens external page that makes ajax requests - credentials are required
When the app uses node http to make some requests. Node http is required to bypass several restrictions of XHR. Credentias are required again

When the password expires or user switches to different network, he must re-enter the credentials . Such cases are impossible to implement

@ayapi
Copy link

ayapi commented Dec 8, 2014

@rogerwang Thank you for your work!
Any plans to support PAC(Proxy Auto-Config)?
auto_detect and pac_url are in net/proxy/proxy_config.cc
but currently in node-webkit App#setProxyConfig() handles only proxy_rules.
PAC is very useful. Please consider it.

@rogerwang
Copy link
Member

@ayapi yeah, would like to support it. Re-open this issue for this.

@rogerwang rogerwang reopened this Dec 8, 2014
@alvinteh
Copy link

I'd like to add that it seems App.setProxyConfig() does not seem to be working - network requests initiated by Chromium still go use the system proxy settings.

Tested with nw 0.11.2 on CentOS 7 (with GNOME desktop) and Squid proxy.

@brospars
Copy link

@tommoor Have you find any solution to autologin in proxy configuration ? My app is meant to run alone without any interaction so I must find a way to do that..

@bestplay
Copy link

bestplay commented Jun 5, 2015

After gui.App.setProxyConfig Devtools show Empty

With 12.0 & 12.2 for win7 32bit .
And operating system is win7 64bit.

After set proxy by setProxyConfig. and proxy works good.
But Devtools show Empty.

My proxy string pass to setProxyConfig is :
"http=192.168.2.2:8087;https=192.168.2.2:8087;socks=direct://" OR
"http=192.168.2.2:8087;direct://"

Both cause the same result.

Remote debugging via local socket?
And how can I passby the local socket for remote debugging?

@aluxian
Copy link

aluxian commented Jun 14, 2015

+1 I have the same problem as @bestplay :(

@Zensin
Copy link

Zensin commented Jun 22, 2015

This can be done by CLI argument in Electron (Previously named Atom Shell) via a commit that was made a while ago right? Should it not now be easy to add to nw.js?

@rogerwang
Copy link
Member

@ayapi the support for auto detect proxy and PAC url will be added in the next 0.12.4 release. Thanks for your patience.

@ayapi
Copy link

ayapi commented Aug 13, 2015

Thank you very much!

@bitnom
Copy link

bitnom commented Feb 5, 2016

I know a lot of people would love to use nwjs for web automation and so being able to rotate proxies with logins and no user interaction required is essential. There are other use-cases as well.

@jakubnavratil
Copy link

Please merge commit by rogerwang c45f686

fujunwei pushed a commit to fujunwei/nw.js that referenced this issue Dec 20, 2016
And implement this feature in nw_app_api.cc.

(cherry picked from commit c45f686)
fujunwei added a commit to fujunwei/nw.js that referenced this issue Dec 20, 2016
fujunwei added a commit to fujunwei/nw.js that referenced this issue Jan 19, 2017
fujunwei added a commit to fujunwei/nw.js that referenced this issue Jan 24, 2017
fujunwei added a commit to fujunwei/nw.js that referenced this issue Jan 24, 2017
fujunwei added a commit to fujunwei/nw.js that referenced this issue Feb 7, 2017
rogerwang pushed a commit that referenced this issue Feb 8, 2017
rogerwang added a commit that referenced this issue Feb 12, 2017
fujunwei added a commit to fujunwei/nw.js that referenced this issue Feb 21, 2017
Add test cases for pac url.

(cherry picked from commit 206df0d)
fujunwei added a commit to fujunwei/nw.js that referenced this issue Feb 21, 2017
Add test cases for pac url.

(cherry picked from commit 206df0d)
fujunwei added a commit to fujunwei/nw.js that referenced this issue Feb 21, 2017
Add test cases for pac url.

(cherry picked from commit 206df0d)
rogerwang pushed a commit that referenced this issue Feb 21, 2017
Add test cases for pac url.

(cherry picked from commit 206df0d)
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