CONNECT

Package: WA2L/edrc 1.5.57
Section: C Library Functions (3)
Index Return to Main Contents
 

NAME

connect - Make socket connection using SOCKS4/5 and HTTP tunnel  

SYNOPSIS

connect [ -dnhst45 ] [ -R resolve ] [ -p local-port ] [ -w seconds ]
  [ -H [ user@ ] proxy-server [ :port ] ]
  [ -S [ user@ ] socks-server [ :port ] ]
  [ -T proxy-server [ :port ] ]
  [ -c telnet proxy command ]
  host port  

DESCRIPTION

Connect is a proxy tool to enable OpenSSH and other TCP/IP utilities to run through SOCKS4/5 and HTTP proxy gateways. The arguments host and port are for the target hostname and port number to connect to.

The -H option specifies the hostname and port number of the HTTP proxy server to be used as the relay. If port is omitted, the default value of 80 will be used. This value can also be specified using the environment variable HTTP_PROXY and pass the -h option to use it.

The -S option specifies the hostname and port number of the SOCKS server to be used as the relay. As with -H, the port number can be omitted, in which case the default value is 1080. This value pair can also be specified in the environment variable SOCKS5_SERVER and use it with the -s option.

The -4 and -5 options are for specifying the SOCKS relaying and indicates which protocol version to use. The options are valid only when used with -s or -S. The default is -5 (protocol version 5).

The -R option is for specifying method to resolve the hostname. Three keywords ( local, remote and both) or an IP address in dot-notation are acceptable. The keyword both means, ``Try local first, then remote''. If a dot-notation IP address is specified, use IP address as the name server. The default is remote for SOCKS5 or local for others. On SOCKS4 protocol, remote resolving method (remote and both) requires a protocol 4a supported server.

The -p option will forward a local TCP port instead of using standard input and output.

The -P option is the same as -p except that it will keep the remote session open. The program will wait the port and hold the remote session without disconnecting. To disconnect the remote session, send EOF to stdin or kill the program.

The -w option specifies timeout seconds for opening a connection with the target host.

The -d option is used for debugging connections. If you fail to connect to a host, use this option to check requests to and responses from server.  

EXAMPLES

You can omit the port argument when program name is special format containing port number itself. For example,
$ ln -s connect connect-25

means this connect-25 command is spcifying port number 25 already, thus the second argument is not needed and it will be ignored if specified.

To use proxy, this example is for SOCKS5 connection to connect to host at port 25 via SOCKS5 server on firewall host.

$ connect -S firewall host 25

or

$ SOCKS5_SERVER=firewall; export SOCKS5_SERVER
$ connect -s host 25

For a HTTP-PROXY connection:

$ connect -H proxy-server:8080 host 25

or

$ HTTP_PROXY=proxy-server:8080; export HTTP_PROXY
$ connect -h host 25

To forward a local port, for example to use ssh:

$ connect -p 5550 -H proxy-server:8080 host 22
($ ssh -l user -p 5550 localhost )

When used with OpenSSH, e.g. ssh(1), connect can be used with ProxyCommand in ssh_config(5) to interoperate with SOCKS gateways.

Host destinationhost

        ProxyCommand connect -R local -S proxygw destinationhost %p 
 

ENVIRONMENT

User name for authentication is passed to connect in an environment variable and if none defined, the system login name will be used. Similarly, the password can be specified by using an environment variable, external program, specified in $SSH_ASKPASS, or from tty.

Following environment variables are used for specifying user name. SOCKS: $SOCKS5_USER, $LOGNAME, $USER
HTTP Proxy: $HTTP_PROXY_USER, $LOGNAME, $USER  

LIMITATIONS

Only USER/PASS authentication is supported in SOCKS5 authentication.

Only HTTP Basic Authentication is supported in HTTP proxy authentication.  

SEE ALSO

ssh(1), ssh_config(5)  

REFERENCES

SOCKS5 - RFC 1928, RFC 1929, RFC 1961
NEC SOCKS Reference Implementation is available from http://www.socks.nec.com.

DeleGate version 5 or earlier can be SOCKS4 server, version 6 can be SOCKS5 and/or SOCKS4 server, and the version 7.7.0 or later can be SOCKS5 and SOCKS4a server. See http://www.delegate.org/delegate/.

Hypertext Transfer Protocol HTTP/1.1 - RFC 2616.
HTTP Basic and Digest Authentication - RFC 2617.


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
ENVIRONMENT
LIMITATIONS
SEE ALSO
REFERENCES

This document was created by man2html using the manual pages.
Time: 16:52:36 GMT, August 28, 2024