anchor.diff:          ?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
  +        _Any -> io:format("Error for handle connection request"), error
       end.
   
   handle_init_request(S, Data) ->
  
positive.code: 
  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}
      end.
  
  
  
negative.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), 
              send_to_local(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.
  %% Implement a queue to send the data sequentially.
  send_to_local(LS, Packet) ->
      Pid = get(LS),
      if 
          Pid == undefined ->
              Npid = spawn(fun() -> async_send_to_local() end),
              put(LS, Npid),
              Npid ! {ok, LS, Packet};
          true ->
              Pid ! {ok, LS, Packet}
      end.
  
  async_send_to_local() ->
      receive
          {ok, S, Packet} -> 
              %%info_msg("start to send data to local"),
              gen_tcp:send(S, Packet),
              async_send_to_local()
      end.
  
  parse_destination_addr(Data) ->
      <<_:3/binary,T,_/binary>> = Data,
  