src/net/socks.js
function SOCKS() {
  if (!(this instanceof SOCKS))
    return new SOCKS();

  EventEmitter.call(this);

  this.socket = new net.Socket();
  this.state = SOCKS.states.INIT;
  this.target = SOCKS.states.INIT;
  this.destHost = '0.0.0.0';
  this.destPort = 0;
  this.username = '';
  this.password = '';
  this.name = 'localhost';
  this.destroyed = false;
  this.timeout = null;
  this.proxied = false;
}
function SOCKS() {
  if (!(this instanceof SOCKS))
    return new SOCKS();

  EventEmitter.call(this);

  this.socket = new net.Socket();
  this.state = SOCKS.states.INIT;
  this.target = SOCKS.states.INIT;
  this.destHost = '0.0.0.0';
  this.destPort = 0;
  this.username = '';
  this.password = '';
  this.name = 'localhost';
  this.destroyed = false;
  this.timeout = null;
  this.proxied = false;
}
function SOCKS ( ) { if ( ! ( this instanceof SOCKS ) ) return new SOCKS ( ) ; EventEmitter . call ( this ) ; this . socket = new net . Socket ( ) ; this . state = SOCKS . states . INIT ; this . target = SOCKS . states . INIT ; this . destHost = '0.0.0.0' ; this . destPort = 0 ; this . username = '' ; this . password = '' ; this . name = 'localhost' ; this . destroyed = false ; this . timeout = null ; this . proxied = false ; }
SOCKS state machine
@constructor
SOCKS state machine