How to unset or remove the proxy option on Erlang httpc client default profile once set?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to unset or remove the proxy option on Erlang httpc client default profile once set?

chris casilli
Hello,

I’m trying to figure out how to remove the proxy option settings once they’ve been set.

The proxy originally is not set and shown as undefined:
httpc:get_options(all).
{ok,[{proxy,{undefined,[]}},
     {https_proxy,{undefined,[]}},
     {pipeline_timeout,0},
     {max_pipeline_length,2},
     {max_keep_alive_length,5},
     {keep_alive_timeout,120000},
     {max_sessions,2},
     {cookies,disabled},
     {verbose,false},
     {ipfamily,inet},
     {ip,default},
     {port,default},
     {socket_opts,[]},
     {unix_socket,undefined}]}
I'm able to set the proxy option without problem:
httpc:set_options([{proxy, {{"www-proxy.mycompany.com", 8000},["localhost"]}}]).
How do you unset the proxy back not undefined (or no proxy) when it is not needed? I tried:

httpc:set_options([{proxy,{undefined, []}}]).
But it throws an exception:
** exception throw: {error,{bad_option,proxy,{undefined,[]}}}
     in function  httpc:bad_option/2 (httpc.erl, line 1102)
     in call from httpc:validate_options/2 (httpc.erl, line 932)
     in call from httpc:validate_options/1 (httpc.erl, line 922)
     in call from httpc:set_options/2 (httpc.erl, line 236)
What am I doing wrong?

Thanks,
Chris Casilli




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions