<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I’m trying to figure out how to remove the proxy option settings once they’ve been set.</div><div class=""><br class=""></div><div class="">The proxy originally is not set and shown as undefined:</div><div class=""><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln">httpc:get_options(all)</span><span class="pun">.</span><span class="pln">
{ok</span><span class="pun">,</span><span class="pln">[{proxy</span><span class="pun">,</span><span class="pln">{undefined</span><span class="pun">,</span><span class="pln">[]}}</span><span class="pun">,</span><span class="pln">
{https_proxy</span><span class="pun">,</span><span class="pln">{undefined</span><span class="pun">,</span><span class="pln">[]}}</span><span class="pun">,</span><span class="pln">
{pipeline_timeout</span><span class="pun">,</span><span class="lit">0</span><span class="pln">}</span><span class="pun">,</span><span class="pln">
{max_pipeline_length</span><span class="pun">,</span><span class="lit">2</span><span class="pln">}</span><span class="pun">,</span><span class="pln">
{max_keep_alive_length</span><span class="pun">,</span><span class="lit">5</span><span class="pln">}</span><span class="pun">,</span><span class="pln">
{keep_alive_timeout</span><span class="pun">,</span><span class="lit">120000</span><span class="pln">}</span><span class="pun">,</span><span class="pln">
{max_sessions</span><span class="pun">,</span><span class="lit">2</span><span class="pln">}</span><span class="pun">,</span><span class="pln">
{cookies</span><span class="pun">,</span><span class="pln">disabled}</span><span class="pun">,</span><span class="pln">
{verbose</span><span class="pun">,</span><span class="pln">false}</span><span class="pun">,</span><span class="pln">
{ipfamily</span><span class="pun">,</span><span class="pln">inet}</span><span class="pun">,</span><span class="pln">
{ip</span><span class="pun">,</span><span class="pln">default}</span><span class="pun">,</span><span class="pln">
{port</span><span class="pun">,</span><span class="pln">default}</span><span class="pun">,</span><span class="pln">
{socket_opts</span><span class="pun">,</span><span class="pln">[]}</span><span class="pun">,</span><span class="pln">
{unix_socket</span><span class="pun">,</span><span class="pln">undefined}]}</span></code></pre></div><div class="">I'm able to set the proxy option without problem:</div><div class=""><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln">httpc:set_options([{proxy</span><span class="pun">,</span><span class="pln"> {{</span><span class="str">"<a href="http://www-proxy.mycompany.com" class="">www-proxy.mycompany.com</a>"</span><span class="pun">,</span><span class="pln"> </span><span class="lit">8000</span><span class="pln">}</span><span class="pun">,</span><span class="pln">[</span><span class="str">"localhost"</span><span class="pln">]}}])</span><span class="pun">.</span></code></pre><div class="">How do you unset the proxy back not undefined (or no proxy) when it is not needed? I tried:</div></div><div class=""><span class="pln"><br class=""></span></div><div class=""><span class="pln">httpc:set_options([{proxy</span><span class="pun">,</span><span class="pln">{undefined</span><span class="pun">,</span><span class="pln"> []}}])</span><span class="pun">.</span></div><div class=""><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="typ">But</span><span class="pln"> it throws an exception:
** exception throw: {error</span><span class="pun">,</span><span class="pln">{bad_option</span><span class="pun">,</span><span class="pln">proxy</span><span class="pun">,</span><span class="pln">{undefined</span><span class="pun">,</span><span class="pln">[]}}}
</span><span class="kwd">in</span><span class="pln"> function httpc:bad_option/</span><span class="lit">2</span><span class="pln"> (httpc</span><span class="pun">.</span><span class="pln">erl</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">1102</span><span class="pln">)
</span><span class="kwd">in</span><span class="pln"> </span><span class="kwd">call</span><span class="pln"> from httpc:validate_options/</span><span class="lit">2</span><span class="pln"> (httpc</span><span class="pun">.</span><span class="pln">erl</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">932</span><span class="pln">)
</span><span class="kwd">in</span><span class="pln"> </span><span class="kwd">call</span><span class="pln"> from httpc:validate_options/</span><span class="lit">1</span><span class="pln"> (httpc</span><span class="pun">.</span><span class="pln">erl</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">922</span><span class="pln">)
</span><span class="kwd">in</span><span class="pln"> </span><span class="kwd">call</span><span class="pln"> from httpc:set_options/</span><span class="lit">2</span><span class="pln"> (httpc</span><span class="pun">.</span><span class="pln">erl</span><span class="pun">,</span><span class="pln"> line </span><span class="lit">236</span><span class="pln">)</span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln">What am I doing wrong?</span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln"><br class=""></span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln">Thanks,</span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln">Chris Casilli</span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln"><br class=""></span></code></pre><pre class="prettyprint prettyprinted lang-erlang"><code class=""><span class="pln"><br class=""></span></code></pre><div class=""><br class=""></div></div></body></html>