20 |
|
|
21 |
my $config = { |
my $config = { |
22 |
yaml_dir => './yaml/', |
yaml_dir => './yaml/', |
23 |
listen => 'localhost:2389', |
listen => 'localhost:1389', |
24 |
upstream_ldap => 'ldap.ffzg.hr', |
upstream_ldap => 'ldap.ffzg.hr', |
25 |
upstream_ssl => 1, |
upstream_ssl => 1, |
26 |
overlay_prefix => 'ffzg-', |
overlay_prefix => 'ffzg-', |
177 |
Proto => 'tcp', |
Proto => 'tcp', |
178 |
Reuse => 1, |
Reuse => 1, |
179 |
LocalAddr => $config->{listen}, |
LocalAddr => $config->{listen}, |
180 |
); |
) || die "can't open listen socket: $!"; |
181 |
|
|
182 |
|
|
183 |
my $targetsock = $config->{upstream_ssl} |
my $targetsock = $config->{upstream_ssl} |
187 |
PeerPort => 389, |
PeerPort => 389, |
188 |
) |
) |
189 |
: IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps') |
: IO::Socket::SSL->new( $config->{upstream_ldap} . ':ldaps') |
190 |
; |
|| die "can't open upstream socket: $!"; |
191 |
|
|
192 |
|
binmode( $listenersock ); |
193 |
|
binmode( $targetsock ); |
194 |
|
|
195 |
run_proxy($listenersock,$targetsock); |
run_proxy($listenersock,$targetsock); |
196 |
|
|