anchor.diff:  
   url_to_ip(URL) ->
       %%io:format("The URL = ~p need to transfer to ip ~n", [URL]),
  -    {S,{hostent,_,_,_,_,Addrs}} = inet:gethostbyname(URL),
  -    case S of
  -        ok ->
  -            [Addr|_] = Addrs,
  -            Addr;
  -        error ->
  -            io:format("Failed to get ip address, URL = ~p",[URL]),
  -            {{},0}
  +    IP = get_ip(URL),
  +    info_msg("######IP = ~p~n",[IP]),
  +    case IP of
  +        undefined ->
  +            {S,{hostent,_,_,_,_,Addrs}} = inet:gethostbyname(URL),
  +            case S of
  +                ok ->
  +                    [Addr|_] = Addrs,
  +                    store_ip(URL, Addr),
  +                    Addr;
  +                error ->
  +                    io:format("Failed to get ip address, URL = ~p",[URL]),
  +                    {{},0}
  +            end;
  +        IP -> info_msg("The cahced ip for host ~p is ~p~n",[URL, IP]), IP
       end.
   
   
  
positive.code: 
  receive_data(S, LocalSocket) ->
      {C, Data} = gen_tcp:recv(S,0,infinity),
      io:format("The data return by the remote server ~p~n",[Data]),
      case C of
          %%ok -> spawn(fun()-> gen_tcp:send(LocalSocket, Data) end), receive_data(S, LocalSocket);
          ok -> gen_tcp:send(LocalSocket, Data), receive_data(S, LocalSocket);
          error -> io:format("##########~p~n",[Data]),gen_tcp:close(S)
      end.
  
  send_data(Socket,Data) ->
      gen_tcp:send(Socket,Data).
  
  %% When the proxy retrive data from the remote,
  %% send the data to the local socket.
  send_to_local(LS, Packet) ->
      receive
      end.
  
  
  parse_destination_addr(Data) ->
      <<_:3/binary,T,_/binary>> = Data,
  
negative.code:     {?CONNECTED,{Addr,trs_port(Port)}}.
  
  handle_reply_request(S, Addr, Data) ->
      %%if byte_size(Data) < 20 ->
      %%   info_msg("New request cycle, Add = ~p, Port = ~B, Data = ~p~n",[Addr, Port, Data])
      %%end,
      {IP, Port} = Addr,
      handle_remote_data(IP, Port, Data, S),
      {?CONNECTED,Addr}. 
  