If you put the following in your init.pl file, it will attempt to parse the http_proxy environment variable and use the result in proxy_for_url/3.
:- use_module(library(socket)).
proxy(Host, Port) :-
getenv("http_proxy", Proxy),
parse_url(Proxy, Attrs),
member(host(Host), Attrs),
member(port(Port), Attrs).
socket:proxy_for_url(A,B,C) :-
proxy(Host, Port),
C = proxy(Host, Port).
