SourceForge Logo

HTTP Proxy Client v0.8.x

HTTP Proxy Client on SourceForge.

  1. Description
  2. Usage
  3. Options
  4. Download
  5. Programs, reported to work with library
  6. Limitations and bugs
  7. Troubleshooting
  8. See also


HTTP Proxy Client is the small set of libraries and scripts, which provides transparent access to Internet via HTTP proxy for programs, which uses TCP/IP for communication.

The list of programs includes: telnet, ftp, licq, cvs, smth else? Project implements dynamic library, that can be preloaded before program run. The library substitutes some system calls (connect(), gethostbyaddr(), gethostbyname()), with calls, which makes TCP/IP connection through HTTP proxy. This allows client programs behind HTTP proxy work with Internet without limitations.

At the moment tested on i386 Linux, i386/sparc Solaris.

The library provides the following functions as replacement for system functions:

socket() monitoring
connect() connect via proxy in case of external host
gethostbyname() DNS resolving
gethostbyname_r()*DNS resolving
gethostbyaddr() DNS reverse resolving
gethostbyaddr_r()*DNS reverse resolving
getaddrinfo() network address and service translation

*: Only for systems, which supports gethostbyname_r() and gethostbyaddr_r().


1. httppc and httppcd libraries.

Library httppc can be used like other libraries: -lhttppc. Check `httppc.h' header file for functions, provided by httppc library.

Library httppcd can be used to add proxy tunneling capability to any program. All you need - is to make final link with -lhttppcd or set LD_PRELOAD to `' full path.

2. `proxed' script.

LD_PRELOAD environment variable can be specified to preload httppcd library before any program run. However, you may need this only for some set of Internet tools. `proxed' script allows to set LD_PRELOAD to `' for single run only. Also you may set HTTP proxy setting right in `proxed' file and don't define them anywhere else.

The package provides also aliases for common Internet tools: telnetx, ftpx, cvsx, licqx which invokes `proxed *' command.

NOTE: instead of setting LD_PRELOAD to full path of `', you can specify the path in LD_LIBRARY_PATH variable.


The control over the driver provided by configuration files checked in the listing order and environment variables. Here is the list of variables with description.

proxy host:port HTTP_PROXY HTTP proxy host in format <host>[:<port>]. Default port is 8080.
auth user:pass HTTP_PROXY_AUTH HTTP proxy user and password in format <user>:<password>.
log verbose|quiet HTTP_PROXY_LOG Driver mode: verbose quiet.
libs lib1:lib2:... HTTP_PROXY_LIBS Libraries, separated by ':', where original functions are located.
xdns dnsip HTTP_PROXY_XDNS External DNS server address, must be in dot notation; by default is set to (
ldns   Use local DNS resolving with native gethostbyname() prior external resolving with ADNS; disabled by default.
local network/mask ... HTTP_PROXY_LOCAL The list of local networks in format <network>/<mask>, separated by space.
extern network/mask ... HTTP_PROXY_EXTERN The list of external networks in format <network>/<mask>, separated by space.
useragent Mozilla...HTTP_PROXY_USERAGENT Add to connection request header string:
User-Agent: <useragent>
nocache   Add to connection request header strings:
Pragma: no-cache
Cache-Control: no-cache
keepalive  Add to connection request header string:
Connection: Keep-Alive
timeout 5 HTTP_PROXY_TIMEOUT Connection timeout in seconds. -1 wait forever.

Networks checking algorithm:

  1. First, driver checks the list of external hosts, if it's not empty and target address in dot format matches some entry, driver runs connect via HTTP proxy.
  2. If list of external hosts is not specified, driver check in the same manner the list of local hosts, and if target address matches some entry, driver runs system connect routine.
  3. If neither list of external hosts, nor list of internal hosts is not specified, driver runs system connect routine and in case of error runs connect via HTTP proxy.

Programs, reported to work with library

NOTE: recent versions of the following programs have their own working HTTP proxy support:

Limitations and bugs

At the moment limitations includes:


1. "error in loading shared libraries: cannot open shared object file: No such file or directory". 2. Programs freezes, with HTTP_PROXY_LOG=verbose, after message "httppc: connecting to: AF_INET, ...".

See also

1. HTTPort 3: TCP/IP through HTTP tunneling software.
2. Tunneling TCP via web-proxy. 3. Tunneling TCP via web-proxy, part2: HTTPort3+HTTHost1=? 4. Proxytunnel is a program that connects stdin and stdout to a server somewhere on the network, through a standard HTTPS proxy. 5. desproxy: HTTPort analog for unix like systems. 6. transconnect: Transparent network over HTTP. 7. transproxy: The program is used in conjunction with the FreeBSD (ipfw and ipnat) or Linux transparent proxy feature (ipfwadm and ipchains), to transparently proxy HTTP requests.
© 2001-2004Alexey Klimkin