Skip to content

Instantly share code, notes, and snippets.

@fredkelly
Created August 3, 2013 17:12
Show Gist options
  • Save fredkelly/6147154 to your computer and use it in GitHub Desktop.
Save fredkelly/6147154 to your computer and use it in GitHub Desktop.
Gmail authentication helper for use with Squid proxy.
#!/usr/bin/env ruby
require 'net/imap'
while true
# open connection
imap = Net::IMAP.new('imap.googlemail.com', 993, true)
# get credentials
user, pass = $stdin.readline.split
# authenticate
begin
imap.login(user, pass)
puts "OK"
rescue Net::IMAP::Error => err
puts "ERR"
end
$stdout.flush
imap.disconnect
end
@dandelioniris
Copy link

Hello,

I dont know how to use squid_auth.rb

@wellington1993
Copy link

@dandelioniris this is a Squid helper for auth . Include this in Squid conf in the auth section. If you need help reply this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment