6.4 TCP socket predicates
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • library(socket): Network socket (TCP and UDP) library
          • TCP socket predicates
            • tcp_socket/1
            • tcp_close_socket/1
            • tcp_open_socket/2
            • tcp_open_socket/3
            • tcp_bind/2
            • tcp_listen/2
            • tcp_accept/3
            • tcp_connect/2
            • tcp_connect/4
            • tcp_connect/3
            • tcp_select/3
            • try_proxy/4
            • proxy_for_url/3
            • tcp_setopt/2
            • tcp_fcntl/3
            • tcp_getopt/2
            • tcp_host_to_address/2
            • gethostname/1
            • negotiate_socks_connection/2
Availability::- use_module(library(socket)).
Source[nondet,multifile]proxy_for_url(+URL, +Hostname, -Proxy)
This hook can be implemented to return a proxy to try when connecting to URL. Returned proxies are tried in the order in which they are returned by the multifile hook try_proxy/4. Pre-defined proxy methods are:
direct
connect directly to the resource
proxy(Host, Port)
Connect to the resource using an HTTP proxy. If the resource is not an HTTP URL, then try to connect using the CONNECT verb, otherwise, use the GET verb.
socks(Host, Port)
Connect to the resource via a SOCKS5 proxy

These correspond to the proxy methods defined by PAC Proxy auto-config. Additional methods can be returned if suitable clauses for http:http_connection_over_proxy/6 or try_proxy/4 are defined.