diff options
author | Mike Crute <mcrute@gmail.com> | 2010-01-17 12:06:15 -0500 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2010-01-17 12:06:15 -0500 |
commit | 55974d21a824378b287e563bce4c32597060cfca (patch) | |
tree | ff8426efe10ff98189fee26583f061fb08f19a50 /cgi-bin/sop_preview_proxy.pl | |
download | santoprene_designer_site-master.tar.bz2 santoprene_designer_site-master.tar.xz santoprene_designer_site-master.zip |
Diffstat (limited to 'cgi-bin/sop_preview_proxy.pl')
-rwxr-xr-x | cgi-bin/sop_preview_proxy.pl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cgi-bin/sop_preview_proxy.pl b/cgi-bin/sop_preview_proxy.pl new file mode 100755 index 0000000..0694e11 --- /dev/null +++ b/cgi-bin/sop_preview_proxy.pl | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # | ||
4 | # Perl Based Same Origin Proxy | ||
5 | # | ||
6 | |||
7 | $|=1; | ||
8 | |||
9 | srand; | ||
10 | use strict; | ||
11 | |||
12 | use Apache::Request; | ||
13 | use LWP::Simple; | ||
14 | use LWP::UserAgent; | ||
15 | |||
16 | my $r = Apache::Request->new(Apache->request); | ||
17 | $r->send_http_header('text/javascript'); | ||
18 | |||
19 | my @url = split(/site=/,$r->parsed_uri()->unparse()); | ||
20 | |||
21 | my $browser = LWP::UserAgent->new; | ||
22 | $browser->credentials( | ||
23 | 'admin.santoprene.com:80', | ||
24 | 'Admin', | ||
25 | 'DESIGNER_SOP_USER' => 'dsop4edit' | ||
26 | ); | ||
27 | |||
28 | print $browser->get($url[1])->content; | ||