Created
August 3, 2013 17:12
-
-
Save fredkelly/6147154 to your computer and use it in GitHub Desktop.
Gmail authentication helper for use with Squid proxy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 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
Hello,
I dont know how to use squid_auth.rb