anchor.diff:  
   -include("include/amqpoxy.hrl").
   
  --record(state, {listener    :: pid(),
  -                client      :: inet:socket(),
  -                backend     :: undefined | inet:socket(),
  -                proxy = ""  :: string(),
  -                protocol    :: module(),
  -                next        :: pos_integer(),
  -                payload     :: undefined | {integer(), pos_integer()},
  -                replay = [] :: [binary()]}).
  -
   %% AMQP frame sizes
   -define(HANDSHAKE, 8).
   -define(HEADER, 7).
  
positive.code: %% @private
  init(Listener, Client, Opts) ->
      ok = cowboy:accept_ack(Listener),
      handshake(#state{proxy    = amqpoxy:format_ip(Opts),
                       listener = Listener,
                       client   = Client,
                       next     = ?HANDSHAKE}).
  
  %%
  %% Private
  
negative.code: handle(<<"AMQP", 1, 1, 9, 1>>, State) ->
      connect({8, 0, 0}, rabbit_framing_amqp_0_8, State);
  handle(<<Type:8, _:16, Len:32>>, State) ->
      handshake(State#state{stage = ?PAYLOAD(Len), payload = {Type, Len}});
  handle(Data, State = #state{protocol = Protocol, payload = {Type, Len}}) ->
      <<Payload:Len/binary, ?FRAME_END>> = Data,
      Login = decode(Type, Payload, Protocol),
  