# File lib/pry-remote-em/server.rb, line 135
    def initialize(obj, opts = {:tls => false})
      @obj              = obj
      @opts             = opts
      @allow_shell_cmds = opts[:allow_shell_cmds]
      @log              = opts[:logger] || ::Logger.new(STDERR)
      # Blocks that will be called on each authentication attempt, prior checking the credentials
      @auth_attempt_cbs = []
      # All authentication attempts that occured before an auth callback was registered
      @auth_attempts    = []
      # Blocks that will be called on each failed authentication attempt
      @auth_fail_cbs    = []
      # All failed authentication attempts that occured before an auth callback was reigstered
      @auth_fails       = []
      # Blocks that will be called on successful authentication attempt
      @auth_ok_cbs      = []
      # All successful authentication attemps that occured before the auth ok callbacks were registered
      @auth_oks         = []

      # The number maximum number of authentication attempts that are permitted
      @auth_tries       = 5
      # Data to be sent after the user successfully authenticates if authentication is required
      @after_auth       = []
      return unless (a = opts[:auth])
      if a.is_a?(Proc)
        return fail("auth handler Procs must take two arguments not (#{a.arity})") unless a.arity == 2
        @auth = a
      elsif a.respond_to?(:call)
        return fail("auth handler must take two arguments not (#{a.method(:call).arity})") unless a.method(:call).arity == 2
        @auth = a
      else
        return error("auth handler objects must respond to :call, or :[]") unless a.respond_to?(:[])
        @auth = lambda {|u,p| a[u] && a[u] == p }
      end
    end