Simon Baynes: Web Development

Default Proxy for ColdFusion

Ever had to develop an application that used cfhttp? Ever done this on a machine that is behind a proxy?

If the answer to those two questions is yes then you may have written some bung code like this:-

    <cfhttp url="" proxyserver="" port="80" throwonerror="true" />

    <!--- if there is an error then we are on live --->
    <cfcatch type="any">
        <cfhttp url="" throwonerror="true" />

This is totally unnecessary as with some jvm.config arguments you can set a default proxy for your ColdFusion instance.

-DproxySet=true -Dhttp.proxyHost= -DproxyPort=80#
By Simon Baynes