.ie \n(.g .ds Aq \(aq .el .ds Aq ' .TH "psocks" "1" "2021\(hy04\(hy08" "PuTTY\ tool\ suite" "PuTTY\ tool\ suite" .SH "NAME" .PP \fBpsocks\fP \- simple SOCKS proxy server .SH "SYNOPSIS" .PP .nf \fBpsocks\fP\ [\ \fB\-d\fP\ ]\ [\ \fB\-f\fP\ |\ \fB\-p\fP\ \fIpipe\-cmd\fP\ ]\ [\ \fB\-g\fP\ ]\ [\ \fIport\-number\fP\ ] .fi .SH "DESCRIPTION" .PP \fBpsocks\fP is a simple SOCKS4/5 proxy server. It supports proxying IPv4 and IPv6 connections. It does not support requiring authentication of its clients. .PP \fBpsocks\fP can be used together with an SSH client such as \fBputty(1)\fP 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. .PP By default, \fBpsocks\fP listens to connections from localhost only, on TCP port 1080. A different \fIport-number\fP can optionally be supplied, and with \fB-g\fP it will listen to connections from any host. .PP \fBpsocks\fP will emit log messages about connections it receives on standard error. With \fB-d\fP, it will log the contents of those connections too. .SH "OPTIONS" .PP The command-line options supported by \fBpsocks\fP are: .IP "\fB-g\fP" Accept connections from anywhere. By default, \fBpsocks\fP only accepts connections on the loopback interface. .IP "\fB--exec\fP \fIcommand\fP" \fBpsocks\fP will run the provided command as a subprocess. When the subprocess terminates, \fBpsocks\fP will terminate as well. .RS .PP All arguments on the \fBpsocks\fP command line after \fB--exec\fP will be treated as part of the command to run, even if they look like other valid \fBpsocks\fP options. .RE .IP "\fB-d\fP" 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). .IP "\fB-f\fP" Record all traffic to files. For every incoming connection, two files are created, \fBsockout.NNNN\fP and \fBsockin.NNNN\fP, where \fINNNN\fP 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. .IP "\fB-p\fP \fIpipe-cmd\fP" Pipe all traffic to a command. For every incoming connection, \fIpipe-cmd\fP is invoked twice: .RS .PP .nf \fIpipe\-cmd\fP\ \fBout\fP\ \fIN\fP \fIpipe\-cmd\fP\ \fBin\fP\ \fIN\fP .fi .PP Each command will run for the direction of a proxied connection, and have the connection's traffic piped into it, similar to \fB-f\fP. .RE .SH "EXAMPLES" .PP In combination with the \fIplink(1)\fP SSH client, to set up a reverse dynamic SSH tunnel, in which the remote listening port 1080 on remote host \fBmyhost\fP acts as a SOCKS server giving access to your local network: .PP .nf psocks\ 12345\ \-\-exec\ plink\ \-R\ 1080:localhost:12345\ user@myhost .fi