anchor.diff:      {Result, Listen} = gen_tcp:listen(Port,[binary,{active,false},{packet,0}, {send_timeout,?CONNECTION_TIMEOUT}]),
       case Result of
           ok ->  new_connection(Listen);
  -        error -> io:format("ERROR, failed to listen on port ~p as ~p",[Port,Listen])
  +        error -> error_msg("ERROR, failed to listen on port ~p as ~p",[Port,Listen])
       end.
   
   %% Initialize the Host to IP cache
  
positive.code: -define(SOCKS_PORT,1080).
  -define(CONNECTION_TIMEOUT, 20000).
  -define(CACHE_EXPIRED,3600).
  
  -type state() :: init|hello|connected.
  
  
negative.code:     end.
  
  url_to_ip(URL) ->
      IP = get_ip(URL),
      case IP of
          undefined ->
  