Sha256: 9756b61f8ae7874bf796290451f6aa9123f8c53f8e69f7608b4d794e387e4ade

Contents?: true

Size: 580 Bytes

Versions: 10

Compression:

Stored size: 580 Bytes

Contents

$: << 'lib' << '../../lib'

require 'em-http'
require 'em-http/middleware/digest_auth'

digest_config = {
  :username => 'digest_username',
  :password => 'digest_password'
}

EM.run do

  conn_handshake = EM::HttpRequest.new('http://localhost:3000')
  http_handshake = conn_handshake.get

  http_handshake.callback do
    conn = EM::HttpRequest.new('http://localhost:3000')
    conn.use EM::Middleware::DigestAuth, http_handshake.response_header['WWW_AUTHENTICATE'], digest_config
    http = conn.get
    http.callback do
      puts http.response
      EM.stop
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
em-http-request-samesite-0.1.1 examples/digest_auth/client.rb
em-http-request-samesite-1.1.7 examples/digest_auth/client.rb
em-http-request-1.1.7 examples/digest_auth/client.rb
em-http-request-1.1.6 examples/digest_auth/client.rb
em-http-request-1.1.5 examples/digest_auth/client.rb
em-http-request-1.1.4 examples/digest_auth/client.rb
em-http-request-1.1.3 examples/digest_auth/client.rb
em-http-request-1.1.2 examples/digest_auth/client.rb
em-http-request-1.1.1 examples/digest_auth/client.rb
em-http-request-1.1.0 examples/digest_auth/client.rb