Skip to content

Commit db0e267

Browse files
check for quotaguard url
1 parent 9daa954 commit db0e267

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/net/ldap.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class LDAP
1616
end
1717
end
1818
require 'socket'
19+
require 'socksify'
1920

2021
require 'net/ber'
2122
require 'net/ldap/pdu'

lib/net/ldap/connection.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,16 @@ def socket
710710
# Wrap around Socket.tcp to normalize with other Socket initializers
711711
class DefaultSocket
712712
def self.new(host, port, socket_opts = {})
713-
Socket.tcp(host, port, socket_opts)
713+
if ENV["QUOTAGUARDSTATIC_URL"] != nil
714+
# puts 'quotaguard url is present'
715+
socks = URI.parse(ENV["QUOTAGUARDSTATIC_URL"].to_s)
716+
puts socks
717+
# http://dl2bwsbvp46amx:[email protected]:9293
718+
# Scoket.tcp()
719+
else
720+
puts 'quotaguard url is NOT present'
721+
Socket.tcp(host, port, socket_opts)
722+
end
714723
end
715724
end
716725
end # class Connection

0 commit comments

Comments
 (0)