simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Feb 23 16:44:20 GMT 2020


TL;DR:
  1b40d9f3 Auxiliary application: 'psocks', a simple SOCKS server.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2020-02-23 16:44:20

commit 1b40d9f3ba810c4fb06ce988e7823fd5ad19b368
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=1b40d9f3ba810c4fb06ce988e7823fd5ad19b368;hp=5a9bfca3d59ecf45466291cae4fb3db30f85157e
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 23 16:27:04 2020 +0000

    Auxiliary application: 'psocks', a simple SOCKS server.
    
    This is built more or less entirely out of pieces I already had. The
    SOCKS server code is provided by the dynamic forwarding code in
    portfwd.c. When that accepts a connection request, it wants to talk to
    an SSH ConnectionLayer, which is already a trait with interchangeable
    implementations - so I just provide one of my own which only supports
    the lportfwd_open() method. And that in turn returns an SshChannel
    object, with a special trait implementation all of whose methods
    just funnel back to an ordinary Socket.
    
    Result: you get a Socket-to-Socket SOCKS implementation with no SSH
    anywhere, and even a minimal amount of need to _pretend_ internally to
    be an SSH implementation.
    
    Additional features include the ability to log all the traffic in the
    form of diagnostics to standard error, or log each direction of each
    connection separately to a file, or for anything more general, to log
    each direction of each connection through a pipe to a subcommand that
    can filter out whatever you think are the interesting parts. Also, you
    can spawn a subcommand after the SOCKS server is set up, and terminate
    automatically when that subcommand does - e.g. you might use this to
    wrap the execution of a single SOCKS-using program.
    
    This is a modernisation of a diagnostic utility I've had kicking
    around out-of-tree for a long time. With all of last year's
    refactorings, it now becomes feasible to keep it in-tree without
    needing huge amounts of scaffolding. Also, this version runs on
    Windows, which is more than the old one did. (On Windows I haven't
    implemented the subprocess parts, although there's no reason I
    _couldn't_.)
    
    As well as diagnostic uses, this may also be useful in some situations
    as a thing to forward ports to: PuTTY doesn't currently support
    reverse dynamic port forwarding (in which the remote listening port
    acts as a SOCKS server), but you could get the same effect by
    forwarding a remote port to a local instance of this. (Although, of
    course, that's nothing you couldn't achieve using any other SOCKS
    server.)

 .gitignore         |   1 +
 Recipe             |  11 +-
 psocks.c           | 630 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 psocks.h           |  28 +++
 unix/uxsocks.c     | 178 +++++++++++++++
 windows/winsocks.c |  24 ++
 6 files changed, 870 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list