anchor.diff:      <<H1,H2>> = Port,
       H1 * 256 + H2.
   
  +
  +ip_cache(IP_map) ->
  +    receive
  +        {'get',Host, Pid} -> 
  +            IP = maps:get(Host,IP_map,undefined),
  +            Pid ! {self(), IP},
  +            ip_cache(IP_map);
  +        {'remove', Host} ->
  +            M2 = maps:remove(Host, IP_map),
  +            ip_cache(M2);
  +        {'cache', Host, IP} ->
  +            M2 = maps:put(Host,{IP, tis()},IP_map),
  +            ip_cache(M2)
  +    end.
  +
  +store_ip(Host, IP) ->
  +    Pid = whereis(cache),
  +    Pid ! {'cache',Host, IP}.
  +
  +get_ip(Host) ->
  +    Pid = whereis(cache),
  +    Pid ! {'get', Host , self()},
  +    receive
  +        {Pid,undefined} -> undefined;
  +        {Pid, {IP, Time}} ->
  +            CurrentTime = tis(),
  +            if 
  +                CurrentTime - Time > 30 ->
  +                    Pid ! {'remove', Host},
  +                    undefined;
  +               true -> IP
  +            end;
  +        _Any -> info_msg("error here ~p~n",[_Any])
  +    end.
  +
  +tis() ->
  +    calendar:datetime_to_gregorian_seconds(calendar:local_time()).
  +    
  
positive.code:         ?INIT -> handle_init_request(S, Data);
          ?HELLO -> handle_hello_request(S, Data);
          ?CONNECTED -> handle_reply_request(S, Addr, Data);
          Any -> io:format("Error for handle connection request"), error
      end.
  
  handle_init_request(S, Data) ->
  
negative.code:     start_socks(1090).
  
  start_socks(Port) ->
      init(),
      {C, Listen} = gen_tcp:listen(Port,[binary,{active,false},{packet,0}]),
      case C of
          ok ->  new_connection(Listen);
          error -> io:format("ERROR, failed to listen on port ~p as ~p",[Port,Listen])
      end.
  
  init() ->
      Pid = spawn(fun() -> ip_cache(#{}) end),
      register(cache, Pid).
  
  new_connection(Listen) ->
      {ok, S} = gen_tcp:accept(Listen),
  