Hi Robin,
it could be an interesting feature.
I did a branch in github about intercepting the proxy request and you 
can take an example in this branch 
(https://github.com/inverse-inc/packetfence/blob/feature/intercept_proxy/lib/pf/web/interceptproxy.pm).
The way it could be done is to work in the dispatcher.pm and add a 
whitelist of web sites and if the uri match (regexp of course), 
packetfence can act as a reverse proxy for your whitelist.

Example in dispatcher.pm:

sub translate {
my ($r) = shift;
my $logger = Log::Log4perl->get_logger(__PACKAGE__);
$logger->trace("hitting translator with URL: " . $r->uri);
# be careful w/ performance here
# Warning: we might want to revisit the /o (compile Once) if we ever want
# to reload Apache dynamically. pf::web::constants will need some
# rework also
if ($r->uri =~/$WEB::ALLOWED_RESOURCES/o) {
# DECLINED tells Apache to continue further mod_rewrite / alias processing
return Apache2::Const::DECLINED;
}
if ($r->uri =~/$WEB::ALLOWED_RESOURCES_MOD_PERL/o) {
$r->handler('modperl');
$r->pnotes->{session_id} = $1;
$r->set_handlers( PerlResponseHandler => ['pf::web::wispr'] );
return Apache2::Const::OK;
}

     if ($r->uri =~ /$WEB::WHITELIST/o) {

       $r->pnotes(  'url_to_mod_proxy'  =>  $r->uri  );

$r->handler('modperl');
$r->set_handlers(PerlFixupHandler => \&fixup);
return Apache2::Const::OK; } }

=item fixup
Last Handler and last chance to do something in the request
=cut
sub fixup {
my $r = shift;
my $logger = Log::Log4perl->get_logger(__PACKAGE__);
if($r->pnotes('url_to_mod_proxy')){
return proxy_redirect($r, $r->pnotes('url_to_mod_proxy'));
}
}
=item proxy_redirect
Mod_proxy redirect
=cut
sub proxy_redirect {
my ($r, $url) = @_;
my $logger = Log::Log4perl->get_logger(__PACKAGE__);
$r->set_handlers(PerlResponseHandler => []);
$r->filename("proxy:".$url);
$r->proxyreq(2);
$r->handler('proxy-server');
return Apache2::Const::OK;
}


Regards
Fabrice


Le 2012-12-12 07:01, Robin Williams a écrit :
> Hi all,
>
> Is there an easy/supported way of allowing certain websites to bypass
> the captive portal login/signup?  At the moment I'm hacking them into
> the httpd config as a proxy host, but it's not nice:
>
> <VirtualHost *:80>
> ServerName www.example.com
> ProxyPassReverse / http://www.example.com/
> ProxyPass / http://www.example.com/
> </VirtualHost>
>
> Thanks,
> Robin.
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> PacketFence-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/packetfence-users


-- 
Fabrice Durand
[email protected] ::  +1.514.447.4918 (x135) ::  www.inverse.ca
Inverse inc. :: Leaders behind SOGo (http://www.sogo.nu) and PacketFence 
(http://packetfence.org)


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users

Reply via email to