Http proxy feature

Can I please please please request that a feature is added to Freepbx to allow you to set an http proxy server for getting updates.

So far I have sunk more than 44 hours into this problem trying all the various workarounds to get it to play nice with squid. Its still not working reliably and I’ve resorted to setting up another external box redirecting to our main proxy.

This is really really messy and when our network admin found out what it was taking to do a simple web update he nearly died. We can’t understand why something as awesome as freepbx doesn’t look at the http_proxy environment variable and use this for web access.

For larger corporates and medium size companies, you can almost gaurantee there will be a proxy server and in these environments freepbx is next to useless without doing major workarounds and hacks which are really messy.

Is it possible to just add a single field to the setup page that allows you to set the proxy server and port, this would make deploying trixbox and keeping it up to date so much easier in a large environment.

If someone knows how to get this into the mainstream code, I’d be happy to do what I can to help and test etc.

I’d happily sacrifice some of the cool wizz bang features that are in development in order to be able to actually deploy freepbx in our environment in the first place.


ps: I can use wget and curl to get the file ok, we are not using sonic wall or any content filtering, the proxy is squid but it is NOT transparent (which appears to be the limitation), I have tried modifying the getxml function without success and dns is fine. We are unable to run our proxy in transparent mode due to an anal network admin.

It seems that nobody is interested to implement this.
I have seen that there are posts with the same request from more than one year and nobody has responded.
I have the same identical situation. I am really frustrated that nobody is interested to this. There are companyes that have a proxy but it seem that the developers don’t have any interest that their software go in there.
Sin, because this also block other projects as, for example, Trixbox.
I have tried to use Trixbox in my company but for the proxy’s limitations I have to give up. Besides the same Trixbox to update/upgrade the own packets doesn’t accept proxy.
It’s doubles limitation. Double frustration. Double abdication :((((

posting a feature request in the forums is not the proper location for it to get noticed by those who do the coding in that section.

You need to go in and report a bug and request feature request.

When Items are posted in the forum they have a short live in the attention span of people. They are never cross referanced for improvement ideas. But if they are entered into the bug trac system they all have to be reviewed and addressed, etc.

Hi tzweistein, I understand your frustration on this one, it drove me mad also.

I was so frustrated I submitted a patch for this issue some time ago and it almost works, unfortunately php is not something I’m strong in so I need some help from someone with better coding skills than me to spot where I’ve gone wrong and help me make it work, tidy it up and finish it off.

I’m not a software developer, I had a go at my first PHP on this one because I really needed this functionality and nobody else was going to do it.

If you know a bit about PHP, maybe someone could lend a hand.
Here is the bug report and patch.

I’m sure once its working, this patch will be accepted into freepbx, it is something a lot of people complain about.


PS you can get around the trixbox issue by setting the http_proxy environment variable and then just doing a yum update at the command line.

I am sorry it, I don’t know PHP. I had understood that fopen doesn’t support proxy and I imagined that it needs to replace it with wget. But not knowing PHP, I don’t know it whether to do.
So, I have applied the patch that you have told about, then I have modified /etc/wgetrc with our proxy configuration.
From command line, as from HTML GUI it is beautifully: IT WORKS!!!
The only small problem is that the directrory /tmp/freepbx doesn’t exist.
This can be workarounded in two ways:

  • create a directory /tmp/freepbx and add the the writings rights to asterisk
  • modify the patch that when download writes in a place where asterisk have rights to write.
    I have chosen the first option:
    #mkdir / tmp/freepbx
    #chown asterisk:asterisk / tmp/freepbx
    #chmod 0744 / tmp/freepbx
    And voilà: now I can see all packages when select “show updates”, download and install them!!!
    Thank you ALL guys, I’m on the right way now.
    I have, also, configurated yum to use proxy and now I have made update of the trixbox.
    It rains out here in Vicenza, but for me it is a beautiful day.
    Thanks to everybody and especially to Toby!

I’m glad it worked for you.
The code needs to be reviewed by someone who knows PHP better than me and to tidy it up a bit.
I didn’t know what I was doing so I assembled the patch by cutting and pasting bits out of scripts that do similar things so it probably violates all sorts of PHP best practice guidelines.

Any update on this?

I’m using FreePBX 2.11 and I can’t find where to input proxy settings.

Of course, I’m unable to even update the modules list from the web…

I’m having a hard time believing FreePBX doesn’t support HTTP PROXY !

Maybe I didn’t find where to configure it?

I see the message that started the thread dates back to 2008, now we’re in 2013 so I can’t believe these isn’t an “official fix” to this?