Command Box cfhttp calls don't work at Corporate workstations behind Proxy Servers

Hi,

There are some issues with using CommandBox in my office. I know another user had this issue but wanted to highlight it as a separate post to see how many people have this problem.

For example, I cannot reach forgebox

struct
Charset [empty string]
ErrorDetail Connect Exception: Connection refused: connect
Filecontent Connection Failure
Header [empty string]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]

Statuscode Connection Failure. Status code unavailable.
Text YES

If I add my proxy information, I receive a reply, note that I’m calling this from outside of command box to show results in a simple test to it returns error, but as you can see I receive a valid reply back from your site.

struct
Charset utf-8
ErrorDetail [empty string]
Filecontent <?xml version="1.0" encoding="utf-8"?>trueInvalid ForgeBox resource

I did a quick search and seems like forgebox.cfc was the only function making a cfhttp call so I updated this function and restarted box and was able to call “forgebox show new interceptors”

<cffunction name=“makeRequest”…

Of course this is not enough as I found out by trying another command - install commandbox-cuck-norris

Fails again so I opened ProgressableDownloader.cfc

// Get connection following redirects
private function resolveConnection( required string downloadURL, redirectUDF ) {
var proxy = new proxy(Proxy.Type.HTTP, new InetSocketAddress(“proxy.corp.net”,8888));
var netURL = createObject( ‘java’, ‘java.net.URL’ ).init( arguments.downloadURL );
var connection = netURL.openConnection(proxy);
connection.setInstanceFollowRedirects( false );

I haven’t used this java version before and it doesn’t seem to like my proxy address but I figure there are a bunch of these as well to review if I were to get this working on my workstation.

I have a work around which is to tether my phone if I need to do some of these cfhttp related functions but others may not have that ability.

Just wondering how many other corporate overlords also make you go through a stupid proxy?

I knew this would come up eventually. So can you create a ticket to provide proxy support.

Thanks.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

https://ortussolutions.atlassian.net/browse/COMMANDBOX-205

Thanks for setting that up. Second question until this gets implemented. I was able to work around the firewall temporarily by connecting through my phone’s hotspot. This allowed me to pull down the packages and install them.

But I’m playing around with this to learn and understand. So I keep running a recipe to reset my environment and kick off the whole process. I assumed that the forgebox install command would look at the artifacts first and not bother to look for updates. This would allow me to connect back up to my company network and keep playing. What appears to be happening is there is a webservice call that checks forgebox again and fails at the proxy. I was hoping it would just deploy from the artifacts directory without checking forgebox. Is this a setting somewhere? Or have I just made another feature request. It would be nice to work in an offline mode if you have all the packages locally.

Yes, right now CommandBox looks up the package first on ForgeBox to get its info (type, version, etc) before it gets to the download phase (which uses artifacts).

I’m in favor of allowing an offline mode, but the reason the API call is required right now is because, unlike NPM, we don’t require a box.json actually be present in the package. This is purely for backwards compat with all the existing stuff on ForgeBox. That means if the zip file does have a box.json, we don’t know what type of package it is (module, for instance). Also, a second reason is that once ForgeBox 2.0 allows for multiple versions of the same package and you don’t request a specific version, we’ll need to ask Forgebox what the latest version of that package even is!

All three of these would require API calls to resolve the semvar range. (Note, none of these are actually supported yet on ForgeBox 1.0)

dependencies = {
“package1” : “*”,
“package2” : “~2.0.0”,
"package3 : “3.*
}

So, in a perfect world every package has a box.json with slug and version required and you can specify an exact version number (like shrinkwrap in NPM) and then we’ll have all the info we need to avoid API calls. I’m not sure how to get around it right now though given the current setups that we allow.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

You know, I should have mentioned this in my last reply but I should also point out that Ortus has plans in a future release to support alternate code endpoints. This means installing packages from a local directory, an internal URL, and even a corporate ForgeBox appliance that you can run behind your firewall for private package management for your team.

We’re also interested in any companies who like this idea enough to be willing to help sponsor its development :slight_smile:

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Just a few thoughts on working offline.

It would be great to have a flag for forgebox install to look in artifacts only. I’ve been doing a lot of experimenting on my current project and have found a need to unplug from our corporate internet connection and use my iPad hotSpot to rerun a recipe that has all the code I need locally.

I appreciate your vision for dependency management, but a quick and not so dirty (potentially very useful) feature would be to be able to work locally with a flag or a switch.

Hope that makes some sense.

Can you create a ticket for this please.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

https://ortussolutions.atlassian.net/browse/COMMANDBOX-206

Thanks.

Gerry, can you please test proxy support on the bleeding edge of CommandBox. I just added support and tried to do some local testing, but I’d like some “real” tests.

http://www.ortussolutions.com/blog/commandbox-300-beta-released-for-testing

Thanks!

~Brad