spug.net.socks
index
/home/mmuller/w/spug/net/socks.py

 
Modules
       
socket
string
struct

 
Classes
       
exceptions.Exception(exceptions.BaseException)
net.socks.Error
net.socks.SOCKSSocket

 
class Error(exceptions.Exception)
    Raised on a protocol error
 
 
Method resolution order:
Error
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x8140ce0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class SOCKSSocket
          This is an extremely simple SOCKS socket class.  To use it
      create an instance, and it will automatically connect to 
      your destination through your SOCKS firewall.
      
      At this point you can either apply socket methods directly
      to this object (optionally using the /reader/ and /writer/
      attributes as input and output files), or you can directly
      operate on the /sock/ attribute, which is the connected
      socket object.
      
      Example:
      
      {{
         # connect to foreign.host.com's http server via 
         # socks-server.domain.com
         s = SOCKSSocket('socks-server.domain.com', 'foreign.host.com', 80)
         
         # get the index page
         s.writer.write('GET /
')
         s.writer.flush()
         
         # read the result
         print s.reader.read()
         
         # close the socket explicitly (this is unnecessary, but demonstrates
         # our direct access to the _real_ socket object.
         s.sock.close()
      }}
      
      Public-vars:
         sock::
            A standard python socket object instance.
         reader::
            Input file object for the socket
         writer::
            Output file object for the socket
 
  Methods defined here:
__getattr__(self, attr)
__init__(self, socksServer, foreignServer, foreignPort, socksPort=1080, userId='')