wso2 / jaggery

The delicious Javascript framework
Apache License 2.0
115 stars 175 forks source link

XMLHttpRequest behind Proxy (in jaggery) #171

Open dkgkim opened 7 years ago

dkgkim commented 7 years ago

When I set up a proxy using Java command line args and then started the business process server, I found that the login to bpmn-explorer failed. As you can see, when calling api with XMLHttpRequest, the java options http.proxyHost and http.proxyPort apply well, but the http.nonProxyHosts option does not apply. .

manuranga commented 7 years ago

Hi Kim, What is the BPS version you are using?

dkgkim commented 7 years ago

Hi, I'm using BPS version 3.6.0. And recently I used BPS included in EI 6.1.0. These modules use Jaggery 0.12.6 and 0.12.8 versions, respectively.

manuranga commented 7 years ago

Hi Kim, We are calling localhost form the bpmn-explorer backend (localhost), as you say, this will go through the proxy, and it's an issue. We can't fix this simply, because the apache http-client version we use (3.1.0) doesn't support ignore proxy setting.

I have created an issue in EI project https://github.com/wso2/product-ei/issues/546 and we will consider it for the next EI release.

Until then, can you please try adding etc/hosts entry to the proxy machine to point back at BPS to solve the issue?

dkgkim commented 7 years ago

Hi, It can be fix by pull request #172. I coded that ignore proxy setting if target url is included in nonProxyHosts. Is that way has any problem?

dkgkim commented 7 years ago

please review the pull request #172 and merge or comment about it.

manuranga commented 7 years ago

Hi Kim, I didn't notice that we create a HttpClient for each XMLHttpRequest (which is wrong). But that make it possible to fix this at per XMLHttpRequest level as you have done. Thank you very much for sending the PR, I will test with EI and merge.