anchor.diff:  init({tcp, http}, _Req, _Options) ->
     {upgrade, protocol, cowboy_websocket}.
   
  -websocket_init(_TransportName, Req, Options) ->
  +websocket_init(TransportName, Req, Options) ->
   	Path = proplists:get_value(path, Options, "./priv"),
   	Handler = proplists:get_value(handler, Options),
     EventManager = proplists:get_value(event_manager, Options, undefined),
  -  State = #state{path = Path, handler = Handler, ws_handler_pid = self()},
     
  +  % on connect handler call
  +  HandlerState = Handler:on_connect(TransportName, Req, Options),
  +
  +  State = #state{path = Path, handler = Handler, ws_handler_pid = self(), ws_handler_state = HandlerState},
     case EventManager of
       undefined -> ok;
       _ -> 
  
positive.code: -record(state, {
    	path,
    	handler,
      ws_handler_pid
  }).
  
  %%% Gen_event behaviour methods
  
negative.code: websocket_info({timeout, _Ref, Msg}, Req, State) ->
  	{reply, {text, Msg}, Req, State};
  
  websocket_info(reconnect, Req, #state{path = _ServerPath, handler = Handler, ws_handler_state = HandlerState} = State) ->
    ReconnectMessage = Handler:handle_reconnect(State, HandlerState),
    {reply, {text, ReconnectMessage}, Req, State};
  
  websocket_info(_Info, Req, State) ->
  