# Am I using the proxy option in http\_get correctly?

**URL:** <https://swi-prolog.discourse.group/t/am-i-using-the-proxy-option-in-http-get-correctly/9006>\
**Category:** General\
**Tags:** bug\
**Created:** [May 15, 2025, 9:06am UTC](https://swi-prolog.discourse.group/t/am-i-using-the-proxy-option-in-http-get-correctly/9006 "2025-05-15T09:06:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DewayneG](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DewayneG](https://swi-prolog.discourse.group/u/DewayneG)\
**Post date:** [May 15, 2025, 9:06am UTC](https://swi-prolog.discourse.group/t/am-i-using-the-proxy-option-in-http-get-correctly/9006/1 "2025-05-15T09:06:10Z")

</div>

Using the “SWI-Prolog (threaded, 64 bits, version 9.2.9)”, I’m unsuccessfully using http\_get with the proxy option. My actions:

```prolog
use_module(library(http/http_open)).
use_module(library(http/http_client)).
% Each of the following, resulting in me timing out
URL='http://www.google.com', http_get(URL,_Data,[status_code(Code),final_url(Location), proxy('b3.hs:3132')]).

URL='http://www.google.com', http_get(URL,_Data,[status_code(Code),final_url(Location), proxy('10.0.5.14:3132')]).

```

A tcpdump reveals (from a separate window)  
18:15:56.932081 IP 10.0.5.102.30932 \> 172.217.24.36.80: Flags [S], seq 1346281332, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 208069181 ecr 0], length 0

Indicating that the proxy option isn’t being used, as the request is being sent directly to [www.google.com](http://www.google.com) (172.217.24.36) over port 80 rather than being proxied.

Am I incorrectly using http\_get’s proxy option?

**Aside** http\_get without using a proxy option to an internal web server

> URL=‘[http://10.0.5.14](http://10.0.5.14)’, http\_get(URL,\_Data,[status\_code(Code),final\_url(Location)]).

was successful 🙂

Platform details: FreeBSD 14.0 x64 with clang version 16.0.6.

---

<div class="post-metadata">

**Author:** ![Ian](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ian/32/1026_2.png) [@Ian](https://swi-prolog.discourse.group/u/Ian)\
**Post date:** [May 15, 2025, 10:01am UTC](https://swi-prolog.discourse.group/t/am-i-using-the-proxy-option-in-http-get-correctly/9006/2 "2025-05-15T10:01:50Z")

</div>

> [@DewayneG](#):
>
> `URL='http://www.google.com', http_get(URL,_Data,[status_code(Code),final_url(Location), proxy('10.0.5.14:3132')]).`

Try using `proxy('10.0.5.14':3132)`. The docs show the option is of the form proxy(host:port).

---

<div class="post-metadata">

**Author:** ![DewayneG](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DewayneG](https://swi-prolog.discourse.group/u/DewayneG)\
**Post date:** [May 15, 2025, 8:09pm UTC](https://swi-prolog.discourse.group/t/am-i-using-the-proxy-option-in-http-get-correctly/9006/3 "2025-05-15T20:09:39Z")

</div>

Thanks Ian, I feel like such a goose. It doesn’t pay to be synchronising shell scripts, while thinking about python source and testing (what I wanted to be doing) threaded networking PROLOG.  
Apologies for generating a silly and false “bug”, which lay with the author :}
