psocks(1)

NAME

psocks - simple SOCKS proxy server

SYNOPSIS

psocks [ -d ] [ -f | -p pipe-cmd ] [ -g ] [ port-number ]

DESCRIPTION

psocks is a simple SOCKS4/5 proxy server. It supports proxying IPv4 and IPv6 connections. It does not support requiring authentication of its clients.

psocks can be used together with an SSH client such as putty(1) to implement a reverse dynamic SSH tunnel. It can also be used for network protocol debugging, as it can record all the traffic passing through it in various ways.

By default, psocks listens to connections from localhost only, on TCP port 1080. A different port-number can optionally be supplied, and with -g it will listen to connections from any host.

psocks will emit log messages about connections it receives on standard error. With -d, it will log the contents of those connections too.

OPTIONS

The command-line options supported by psocks are:

-g  Accept connections from anywhere. By default, psocks only accepts connections on the loopback interface.

--exec command
    psocks will run the provided command as a subprocess. When the subprocess terminates, psocks will terminate as well.

    All arguments on the psocks command line after --exec will be treated as part of the command to run, even if they look like other valid psocks options.

-d  Log all traffic to standard error, in a more or less human-readable form (in addition to messages about connections being opened and closed, which are always logged).

-f  Record all traffic to files. For every incoming connection, two files are created, sockout.NNNN and sockin.NNNN, where NNNN is a decimal index starting at 0 identifying the proxied connection. These record, respectively, traffic from the SOCKS client, and from the server it connected to through the proxy.

-p pipe-cmd
    Pipe all traffic to a command. For every incoming connection, pipe-cmd is invoked twice:

    pipe-cmd out N
    pipe-cmd in N

    Each command will run for the direction of a proxied connection, and have the connection's traffic piped into it, similar to -f.

EXAMPLES

In combination with the plink(1) SSH client, to set up a reverse dynamic SSH tunnel, in which the remote listening port 1080 on remote host myhost acts as a SOCKS server giving access to your local network:

psocks 12345 --exec plink -R 1080:localhost:12345 user@myhost