I was basing it how jose did gen_server behavior https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/gen_server/behaviour.ex 

init, websocket_* need to be in the module definition or else cowboy doesn't see them. And the others are overrideable.