README for SOCKS module for python interpreter

originally released:

Daniel W. Connolly, HaL Software Systems <connolly@hal.com>
Id: socksForPython.html,v 1.1 1994/09/19 16:54:46 connolly Exp

What Is socksForPython?

This is a python module that works just like the socket module, but uses the SOCKS protocol to make connections through a firewall machine. See README.socks for more info on SOCKS.

This has been tested with

How Do I Build/Install/Use it?

  1. Download socksForPython.tar.gz
  2. Get and build python
  3. Get and build SOCKS ( I can't seem to find version 4.2 source through archie. Perhaps the author <ylee@syl.dl.nec.com> could help. Perhaps version 4.1 would be enough for your purposes. Archie lists ftp://arthur.cs.purdue.edu/pub/pcert/tools/unix/socks.cstc.4.1.tar.gz size: 227733 date: Dec 16 00:00 among others)
  4. Put this directory in the python source tree under python/Extensions
  5. Edit the Makefile to point to your python and SOCKS installations
  6. If you're using SunOS 4.1.3 and you have gcc installed, you can build a dynamically linked module. Just invoke 'make' and you'll end up with SOCKSmodule.so . Put that in your $PYTHONPATH, and you're all set. (This might work for other platforms too, but I have no way to find out!)
  7. Otherwise, you can build socksmodule.o and link it into the interpreter using the normal python Extensions mechanism. See Makefile.pre.in for details.
  8. Set up the SOCKS server, and set your $SOCKS_SERVER appropriately (I assume you or somebody at your site knows how to set up the socks server, or you wouldn't be interested in this package in the first place.)
  9. To use the SOCKS module in python code, I just replace:
    	import socket
    

    with

    	try:
    		import SOCKS; socket = SOCKS
    	except ImportError:
    		import socket
    
  10. included is a patch to ftplib.py that will make it (1) import SOCKS as above, and (2) set up the data connection in a way that SOCKS can handle.

Bugs/Limitations

Note that SOCKS makes some assumptions about the way the socket library is used. See What_SOCKS_expects.

XXX socksmodule.c should be tweaked to raise exceptions for things that SOCKS doesn't support.

Copyright Info

Technically speaking, this is copyright (c) 1994 by HaL Computer Systems, since I developed it using their resources. There's so little novel work here that I don't see the point in reserving any copyrights. Anyway...

Copyright 1994 by HaL Computer Systems.

All Rights Reserved

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of HaL Computer Systems not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

HAL COMPUTER SYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HAL COMPUTER SYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.